// Version: 2019.1.15 9:41:39 #ifndef _T_CYC_DATA_H #define _T_CYC_DATA_H #include #include #include #ifdef _MSC_VER #pragma warning(disable:4996) #pragma warning(disable:4267) #endif #include "T_CYC_DATADBAX.h" class T_CYC_DATA{ friend class T_CYC_DATADBAX; private: //aggregation to DB Class T_CYC_DATADBAX 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_ctime[27]; double d_data[800]; short s_dataZi[800]; // arguments for Primary key char c_k_ctime[27]; public: // // LTA Structure struct STR_T_CYC_DATA{ char ctime[27]; double data[800]; }structTable; // LTA Structure Zi struct STR_T_CYC_DATAZi{ short dataZi[800]; }structTableZi; // //C O N S T R U C T O R S //======================= // public: T_CYC_DATA(); //D E S T R U C T O R S //======================= // virtual ~T_CYC_DATA(); // //C O P Y - C O N S T R U C T O R //======================= T_CYC_DATA(const T_CYC_DATA &inst); // For Constructors with parameters the flag dbAccess // informs you if the access was successfully or not T_CYC_DATA( char* arg1); //methods public: char* getCreationTime() {return "2019.1.15 9:41:39";}; //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(char* arg1 ); // public methode initInsertKeys // // this methode stores the unique key attributes // void initInsertKeys( char* arg1 ); 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_CYC_DATA operator+(const T_CYC_DATA &inst) const; // //O P E R A T O R = //=================== // public: const T_CYC_DATA& operator=(const T_CYC_DATA &inst); char* ctime() const;//{ //return((char*)c_ctime ); //} void set_ctime( char* arg );//{ //strncpy((char*)c_ctime , arg , sizeof(c_ctime)); //c_ctime[sizeof(c_ctime)-1] = '\0'; //return; //} int dataArraySize();//{ //return(800); //} double data(int colInd) const;//{ //return((double)d_data[colInd] ); //} short dataZi(int colInd) const;//{ //return( s_dataZi[colInd]); //} void set_data( int colInd, double arg );//{ //d_data[colInd] = arg; //s_dataZi[colInd]= 0; //return; //} void set_dataZi( int colInd, short arg );// { //s_dataZi[colInd] = arg; //} public: // methodes for Primary key char* k_ctime();//{ //return((char*)c_k_ctime ); //} void set_k_ctime( char* arg );//{ //strncpy((char*)c_k_ctime , arg , sizeof(c_k_ctime)); //c_k_ctime[sizeof(c_k_ctime)-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("T_CYC_DATA"); //} /////////////////////////////////////////////////// int getSqlCode();//{ //return( db.dbSqlCode); //} /////////////////////////////////////////////////// int getRowsProcessed();//{ //return( db.dbRowsProcessed); //} }; #endif