// Version: 2020.10.16 10:6:6 #ifndef _T_RULE_SAMPLETIME_H #define _T_RULE_SAMPLETIME_H #include #include #include #ifdef _MSC_VER #pragma warning(disable:4996) #pragma warning(disable:4267) #endif #include "T_RULE_SAMPLETIMEDBAX.h" class T_RULE_SAMPLETIME{ friend class T_RULE_SAMPLETIMEDBAX; private: //aggregation to DB Class T_RULE_SAMPLETIMEDBAX db; public: // //A T T R I B U T E S //=================== // bool dbAccess; char* dbMessage;// pointer for the return values of DBAX methodes char messageBuffer[200];// temporary message buffer friend class PapLib; protected: // //A T T R I B U T E S //=================== // char c_RuleId[50+1]; char c_sampleDate[27]; char c_tagName[50+1]; short s_tagNameZi; double d_data; short s_dataZi; // arguments for Primary key char c_k_RuleId[50+1]; char c_k_sampleDate[27]; public: // // LTA Structure struct STR_T_RULE_SAMPLETIME{ char RuleId[50+1]; char sampleDate[27]; char tagName[50+1]; double data; }structTable; // LTA Structure Zi struct STR_T_RULE_SAMPLETIMEZi{ short tagNameZi; short dataZi; }structTableZi; // //C O N S T R U C T O R S //======================= // public: T_RULE_SAMPLETIME(); //D E S T R U C T O R S //======================= // virtual ~T_RULE_SAMPLETIME(); // //C O P Y - C O N S T R U C T O R //======================= T_RULE_SAMPLETIME(const T_RULE_SAMPLETIME &inst); // For Constructors with parameters the flag dbAccess // informs you if the access was successfully or not T_RULE_SAMPLETIME( const char* arg1,char* arg2); //methods public: char* getCreationTime() {return (char*)"2020.10.16 10:6:6";}; //initial data void initial(); //read data char* readDB(); //update data char* updateDB(); //insert data char* insertDB(); //this methode tries to update a DB record , when the update fails , the methode //tries an insert of the failed record char* storeDB(); //delete data char* deleteDB(); //delete data char* deleteDB(const char* where , long* count ); //openSetDB data char* openSetDB(const char* where ,const char* order ); //getSetDB data char* getSetDB(); //closeSetDB data char* closeSetDB(); //countDB data char* countDB(const char* where , long* count ); char* execute(const char* sql , long* count ); char* dbCommit(); char* dbRollback(); public: // // public methode setPrimKey // // this methode stores the unique key attributes // void setPrimKey(const char* arg1 , char* arg2 ); // public methode initInsertKeys // // this methode stores the unique key attributes // void initInsertKeys( const char* arg1 , char* arg2 ); public: // // public methode setKeysFromRecord // // this methode set the unique key attributes from the DB Record Attributes // void setKeysFromRecord(); // //O P E R A T O R + //=================== // public: T_RULE_SAMPLETIME operator+(const T_RULE_SAMPLETIME &inst) const; // //O P E R A T O R = //=================== // public: const T_RULE_SAMPLETIME& operator=(const T_RULE_SAMPLETIME &inst); char* RuleId() const;//{ //return((char*)c_RuleId ); //} void set_RuleId( const char* arg );//{ //strncpy((char*)c_RuleId , arg , sizeof(c_RuleId)); //c_RuleId[sizeof(c_RuleId)-1] = '\0'; //return; //} char* sampleDate() const;//{ //return((char*)c_sampleDate ); //} void set_sampleDate( char* arg );//{ //strncpy((char*)c_sampleDate , arg , sizeof(c_sampleDate)); //c_sampleDate[sizeof(c_sampleDate)-1] = '\0'; //return; //} char* tagName() const;//{ //return((char*)c_tagName ); //} short tagNameZi() const;//{ //return( s_tagNameZi); //} void set_tagName( const char* arg );//{ //strncpy((char*)c_tagName , arg , sizeof(c_tagName)); //c_tagName[sizeof(c_tagName)-1] = '\0'; //s_tagNameZi= 0; //return; //} void set_tagNameZi( short arg ) ;//{ //s_tagNameZi = arg; //} double data() const;//{ //return((double)d_data ); //} short dataZi() const;//{ //return( s_dataZi); //} void set_data( double arg );//{ //d_data = arg; //s_dataZi= 0; //return; //} void set_dataZi( short arg ) ;//{ //s_dataZi = arg; //} public: // methodes for Primary key char* k_RuleId();//{ //return((char*)c_k_RuleId ); //} void set_k_RuleId( char* arg );//{ //strncpy((char*)c_k_RuleId , arg , sizeof(c_k_RuleId)); //c_k_RuleId[sizeof(c_k_RuleId)-1] = '\0'; //return; //} char* k_sampleDate();//{ //return((char*)c_k_sampleDate ); //} void set_k_sampleDate( char* arg );//{ //strncpy((char*)c_k_sampleDate , arg , sizeof(c_k_sampleDate)); //c_k_sampleDate[sizeof(c_k_sampleDate)-1] = '\0'; //return; //} public: // // public methode fillStructure // // this methode filles the classstructue with the private attributes // void fillStructure();//{ //} /////////////////////////////////////////////////// void fillStructureZi();//{ //} /////////////////////////////////////////////////// void setStructure();// { //return; //} /////////////////////////////////////////////////// void setStructureZi() ;//{ //} /////////////////////////////////////////////////// char* getName();//{ //return((char*)"T_RULE_SAMPLETIME"); //} /////////////////////////////////////////////////// int getSqlCode();//{ //return( db.dbSqlCode); //} /////////////////////////////////////////////////// int getRowsProcessed();//{ //return( db.dbRowsProcessed); //} }; #endif