// Version: 2019.3.18 13:28:11 #ifndef _T_BPC_TRIGGER_H #define _T_BPC_TRIGGER_H #include #include #include #include #ifdef _MSC_VER #pragma warning(disable:4996) #pragma warning(disable:4267) #endif #include "T_BPC_TRIGGERDBAX.h" class T_BPC_TRIGGER{ friend class T_BPC_TRIGGERDBAX; private: //aggregation to DB Class T_BPC_TRIGGERDBAX 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 char jsonBuffer[20000]; friend class PapLib; protected: // //A T T R I B U T E S //=================== // long l_Seq; char c_EventName[21+1]; char c_Field[60+1]; short s_FieldZi; char c_DataValue[60+1]; short s_DataValueZi; long l_STATUS; short s_STATUSZi; long l_datai[10]; short s_dataiZi[10]; double d_dataf[10]; short s_datafZi[10]; char c_datac[10][16+1]; short s_datacZi[10]; char c_toc[27]; short s_tocZi; char c_tom[27]; short s_tomZi; char c_mop[121]; short s_mopZi; char c_mou[31]; short s_mouZi; // arguments for Primary key long l_k_Seq; public: // // LTA Structure struct STR_T_BPC_TRIGGER{ int Seq; char EventName[21+1]; char Field[60+1]; char DataValue[60+1]; int STATUS; int datai[10]; double dataf[10]; char datac[10][16+1]; char toc[27]; char tom[27]; char mop[121]; char mou[31]; }structTable; // LTA Structure Zi struct STR_T_BPC_TRIGGERZi{ short FieldZi; short DataValueZi; short STATUSZi; short dataiZi[10]; short datafZi[10]; short datacZi[10]; short tocZi; short tomZi; short mopZi; short mouZi; }structTableZi; // //C O N S T R U C T O R S //======================= // public: T_BPC_TRIGGER(); //D E S T R U C T O R S //======================= // virtual ~T_BPC_TRIGGER(); // //C O P Y - C O N S T R U C T O R //======================= T_BPC_TRIGGER(const T_BPC_TRIGGER &inst); // For Constructors with parameters the flag dbAccess // informs you if the access was successfully or not T_BPC_TRIGGER( long arg1); //methods public: char* getCreationTime() {return (char*)"2019.3.18 13:28:11";}; //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(long arg1 ); // public methode initInsertKeys // // this methode stores the unique key attributes // void initInsertKeys( long 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_BPC_TRIGGER operator+(const T_BPC_TRIGGER &inst) const; // //O P E R A T O R = //=================== // public: const T_BPC_TRIGGER& operator=(const T_BPC_TRIGGER &inst); long Seq() const;//{ //return((long)l_Seq ); //} void set_Seq( long arg );//{ //l_Seq = arg; //return; //} char* EventName() const;//{ //return((char*)c_EventName ); //} void set_EventName( const char* arg );//{ //strncpy((char*)c_EventName , arg , sizeof(c_EventName)); //c_EventName[sizeof(c_EventName)-1] = '\0'; //return; //} char* Field() const;//{ //return((char*)c_Field ); //} short FieldZi() const;//{ //return( s_FieldZi); //} void set_Field( const char* arg );//{ //strncpy((char*)c_Field , arg , sizeof(c_Field)); //c_Field[sizeof(c_Field)-1] = '\0'; //s_FieldZi= 0; //return; //} void set_FieldZi( short arg ) ;//{ //s_FieldZi = arg; //} char* DataValue() const;//{ //return((char*)c_DataValue ); //} short DataValueZi() const;//{ //return( s_DataValueZi); //} void set_DataValue( const char* arg );//{ //strncpy((char*)c_DataValue , arg , sizeof(c_DataValue)); //c_DataValue[sizeof(c_DataValue)-1] = '\0'; //s_DataValueZi= 0; //return; //} void set_DataValueZi( short arg ) ;//{ //s_DataValueZi = arg; //} long STATUS() const;//{ //return((long)l_STATUS ); //} short STATUSZi() const;//{ //return( s_STATUSZi); //} void set_STATUS( long arg );//{ //l_STATUS = arg; //s_STATUSZi= 0; //return; //} void set_STATUSZi( short arg ) ;//{ //s_STATUSZi = arg; //} int dataiArraySize();//{ //return(10); //} long datai(int colInd) const;//{ //return((int)l_datai[colInd] ); //} short dataiZi(int colInd) const;//{ //return( s_dataiZi[colInd]); //} void set_datai( int colInd, long arg );//{ //l_datai[colInd] = arg; //s_dataiZi[colInd]= 0; //return; //} void set_dataiZi( int colInd, short arg );// { //s_dataiZi[colInd] = arg; //} int datafArraySize();//{ //return(10); //} double dataf(int colInd) const;//{ //return((double)d_dataf[colInd] ); //} short datafZi(int colInd) const;//{ //return( s_datafZi[colInd]); //} void set_dataf( int colInd, double arg );//{ //d_dataf[colInd] = arg; //s_datafZi[colInd]= 0; //return; //} void set_datafZi( int colInd, short arg );// { //s_datafZi[colInd] = arg; //} int datacArraySize();//{ //return(10); //} char* datac(int colInd) const;//{ //return((char*)c_datac[colInd] ); //} short datacZi(int colInd) const;//{ //return( s_datacZi[colInd]); //} void set_datac( int colInd, const char* arg );//{ //strncpy((char*)c_datac[colInd] , arg , sizeof(c_datac[colInd])); //c_datac[colInd][sizeof(c_datac[colInd])-1] = '\0'; //s_datacZi[colInd]= 0; //return; //} void set_datacZi( int colInd, short arg );// { //s_datacZi[colInd] = arg; //} public: char* toc() const;//{ //return((char*)c_toc ); //} short tocZi() const;//{ //return( s_tocZi); //} protected: void set_toc( char* arg );//{ //strncpy((char*)c_toc , arg , sizeof(c_toc)); //c_toc[sizeof(c_toc)-1] = '\0'; //s_tocZi= 0; //return; //} void set_tocZi( short arg );//{ //s_tocZi = arg; //} public: char* tom() const;//{ //return((char*)c_tom ); //} short tomZi() const;//{ //return( s_tomZi); //} protected: void set_tom( char* arg );//{ //strncpy((char*)c_tom , arg , sizeof(c_tom)); //c_tom[sizeof(c_tom)-1] = '\0'; //s_tomZi= 0; //return; //} void set_tomZi( short arg );//{ //s_tomZi = arg; //} public: char* mop() const;//{ //return((char*)c_mop ); //} short mopZi() const;//{ //return( s_mopZi); //} protected: void set_mop( char* arg );//{ //strncpy((char*)c_mop , arg , sizeof(c_mop)); //c_mop[sizeof(c_mop)-1] = '\0'; //s_mopZi= 0; //return; //} void set_mopZi( short arg );//{ //s_mopZi = arg; //} public: char* mou() const;//{ //return((char*)c_mou ); //} short mouZi() const;//{ //return( s_mouZi); //} protected: void set_mou( char* arg );//{ //strncpy((char*)c_mou , arg , sizeof(c_mou)); //c_mou[sizeof(c_mou)-1] = '\0'; //s_mouZi= 0; //return; //} void set_mouZi( short arg );//{ //s_mouZi = arg; //} public: // methodes for Primary key long k_Seq();//{ //return((long)l_k_Seq ); //} void set_k_Seq( long arg );//{ //l_k_Seq = arg; //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_BPC_TRIGGER"); //} /////////////////////////////////////////////////// int getSqlCode();//{ //return( db.dbSqlCode); //} /////////////////////////////////////////////////// int getRowsProcessed();//{ //return( db.dbRowsProcessed); //} string getJson(); }; #endif