#ifndef __TSlowControlMySQLRow__ #define __TSlowControlMySQLRow__ #include #include #include #include #include #include #include #include #include "TSQLRow.h" #include "TSQLResult.h" #include "ICOMETLog.hxx" /// Helper class; used to store the results for a particular row of a particular table. class ISlowControlMySQLRow { public: ISlowControlMySQLRow(TSQLResult *result, TSQLRow *row, std::string itable_name); ~ISlowControlMySQLRow(){ if(fSQLResult) delete fSQLResult; if(fSQLRow) delete fSQLRow; }; // Return float value of entry for field. bool HasField(std::string field); // Return float value of entry for field. float GetValueFloat(std::string field); // Return integer value of entry for field. int GetValueInteger(std::string field); // Return string value of entry for field. std::string GetValueString(std::string field); // Print the contents of this table row void Print(); // Methods associated with start and end of time interval. void SetEndTime(int interval_end_time); int GetEndTime(){return fEndTime;} int GetStartTime(){return fStartTime;} /// Method checks if this is the last row of table. /// It checks this by looking at row end time, which will be 0x7fffffff /// if this is the last row. bool IsLastRow(); // Get the table name std::string GetTableName(){return table_name;} private: int fEndTime; int fStartTime; std::string table_name; TSQLResult* fSQLResult; TSQLRow* fSQLRow; }; #endif