00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef HISTORY_H
00013 #define HISTORY_H
00014
00015 #include <string>
00016 #include <vector>
00017
00018
00019
00020
00021 class MidasHistoryInterface;
00022 class MidasSqlInterface;
00023
00024
00025
00026 MidasHistoryInterface* MakeMidasHistory();
00027 MidasHistoryInterface* MakeMidasHistoryODBC();
00028 MidasHistoryInterface* MakeMidasHistorySqlDebug();
00029
00030
00031
00032 class MidasHistoryInterface
00033 {
00034 public:
00035 virtual ~MidasHistoryInterface() { };
00036
00037 public:
00038 virtual int hs_connect(const char* connect_string) = 0;
00039 virtual int hs_disconnect() = 0;
00040
00041 virtual int hs_set_debug(int debug) = 0;
00042
00043 virtual int hs_clear_cache() = 0;
00044
00045
00046
00047 virtual int hs_define_event(const char* event_name, int ntags, const TAG tags[]) = 0;
00048
00049 virtual int hs_write_event(const char* event_name, time_t timestamp, int data_size, const char* data) = 0;
00050
00051
00052
00053 virtual int hs_get_events(std::vector<std::string> *pevents) = 0;
00054
00055 virtual int hs_get_tags(const char* event_name, std::vector<TAG> *ptags) = 0;
00056
00057 virtual int hs_read(time_t start_time, time_t end_time, time_t interval,
00058 int num_var,
00059 const char* event_name[], const char* tag_name[], const int var_index[],
00060 int num_entries[],
00061 time_t* time_buffer[], double* data_buffer[],
00062 int status[]) = 0;
00063 };
00064
00065 #endif
00066