
/*-----------------------------------------------------------------------------------------------*/
/* interface/statistics.h 	                                                                     */
/* copyright (c) innovaphone 2013                                                                */
/*                                                                                               */
/*-----------------------------------------------------------------------------------------------*/

class IStatisticsProvider * CreateStatisticsProvider();

class IStatisticsProvider {
public:
    virtual ~IStatisticsProvider() {};
    virtual class IStatistics * CreateStatistics(class IInstanceLog* const log) = 0;
};

enum StatisticsType {
    StatisticsCumulative,
    StatisticsState
};

class IStatistics : public UJsonApiContext {
public:
    virtual ~IStatistics() {};
    virtual void Init(class UStatistics * user, class IDatabase * database) = 0;
    virtual void StartMonitor(const char * type, class json_io & send, word base, char *& tmp) = 0;
    virtual void Close() = 0;

    virtual void CreateCategory(const char * name) = 0;
    virtual void CreateChart(const char * category, const char * name, const char * condition) = 0;
    virtual class IStatisticsDataset * CreateDataset(const char * name, enum StatisticsType type, class UStatisticsDataset * provider = 0) = 0;
};

class UStatistics {
public:
    virtual void StatisticsInitComplete() = 0;
    virtual void StatisticsCloseComplete() = 0;
    virtual void StatisticsMonitorUpdate(const char * name, long64 value) {};
};

