//---------------------------------------------------------------------------

#ifndef pla_importH
#define pla_importH
//---------------------------------------------------------------------------
#include "hub/hub.h"
#include "pla_parser.h"
#include "import.h"

class PlaImport: public PlaParserClient, public Import {
private:
    PlaParser parser_;
    std::string fn;
    hub::Location* dest_;

protected:
    virtual void haveInPorts(int portsCount, std::list<std::string> portNames);
    virtual void haveOutPorts(int portsCount, std::list<std::string> portNames);
    virtual void haveDescription(std::string& type, int inNo, int outNo, std::list<std::string>&, 
							   std::list<std::string>&, std::list<std::string> &matrix);

public:
    virtual void operator() (std::istream*, const std::string&, Import::Destinations&);
    PlaImport(hub::Hub* h): parser_(this) {}
};

// ==========================================================================
class PlaImpLang: public ImportLang {
public:
    static void enregister (void);
    PlaImpLang (const std::string& n): ImportLang(n) {}
    Import* getImporter (hub::Hub* theHub) { return new PlaImport (theHub); }
    void getDefaults (hub::Hub*, const std::string&, Import::Destinations&);
};

#endif
