//---------------------------------------------------------------------------
#ifndef pla_exportH
#define pla_exportH

#include <map>

#include "trav.h"
#include "export.h"
#include "hub/hub.h"
#include "util/indent.h"
#include "hub/pla.h"
class PlaPlaTable;
//---------------------------------------------------------------------------
class PlaExport:
public TopTraverserClient,
public Export {
    friend class PlaPlaTable;
private:
    TopTraverser traverser_;
    std::ostream* out_;
    int inpN, outN;

public:
    virtual void havePortProto (hub::PortProto*);
    virtual void haveArch (hub::Architecture*);

public:
    virtual void operator() (std::ostream* os, Export::Source* src);

    PlaExport (hub::Hub*);
    ~PlaExport () {}
};

// ========== wrappers that introduce repr functions into exportMap =======
class PlaPlaTable {
public:
	static bool Represent (PlaExport&, hub::PlaDescr&);
	static int wantInit;
};
// ======================================================================================
class PlaExpLang: public ExportLang {
public:
    static void enregister (void);
    PlaExpLang (const std::string& n): ExportLang(n) {}
    Export* getExporter (hub::Hub& theHub) { return new PlaExport (&theHub); }
    void getDefaults (hub::Hub* h, const std::string& fn, Export::Source&);
};

#endif
