#pragma once

//#include "BaseModule.h"
//#include "libaray_symbols.h"
#include "MWareInterface.h"
#include <QtNetwork/QUdpSocket>
#include <QtCore/QVariant>
#include <QtCore/QObject>

// insert into lpmcs.dev_12345 values(now,1,2,3)
// topic:topic_dev_12346
class TDAgent : public QObject,public EventSubInterface//,public BaseModule
{
	Q_OBJECT
public:
    TDAgent();
    ~TDAgent();

private:
//    virtual void Setup(ModuleInfo mi) {};
//    virtual void regConsumer(DataConsumer* pDC) {};
//    virtual bool isInheritedFrom(std::string tp) {return false;};
//    virtual void OnSubData(std::string name,std::string val) {};

private:

signals:
    void sigEvent(const std::string topic, const std::string msg);

private:
    void SubCB(const std::string topic, const std::string msg);

public:
    bool Connect(tagSetup ts);
    bool Subscribe(std::list<std::string> lstTopic);
    void Publish(std::string,QVariant v);
};

//extern "C" {//一定要添加上
//TDEGENT_EXPORT BaseModule* instance();
//TDEGENT_EXPORT void destroy(BaseModule*);
//}
