#ifndef DATASUBSCRIBE_H
#define DATASUBSCRIBE_H

//#include "BaseModule.h"
#include <QtCore/QThread>
#include "DataConsumer.h"
#include "Define.h"
#include <QDateTime>

class SharedData;

class DataSubscribe : public QObject//, public BaseModule
{
public:
    DataSubscribe();
    ~DataSubscribe();
    virtual void Setup(ModuleInfo& mi);

    virtual std::string getTypeList();

    virtual void regConsumer(DataConsumer* dc) ;

    void OnData(const QString& user, const QString& key, const QVariant& val);
    //void OnData(QString, QString, QVariant);
// private:
//     virtual void setLoader(QLibrary*);
private:
    QLibrary* library = nullptr;
    QList<DataConsumer*> dataConsumerList;
    std::string dataName;
    ModuleInfo mi;
    SharedData* shares;

};

#endif // DATASUBSCRIBE_H
