// Version: 2019.4.4 10:22:45 // File: T_PDO_RADAR.cpp #include "T_PDO_RADAR.h" T_PDO_RADAR::T_PDO_RADAR(){ // initialise all membervariables initial(); } T_PDO_RADAR::~T_PDO_RADAR(){ } void T_PDO_RADAR::initial(){ // initialise all membervariables set_extId((char*)""); set_value((char*)""); set_valueZi(-1); set_TC((char*)""); set_TCZi(-1); // initialies Primary key members set_k_extId((char*)""); } T_PDO_RADAR::T_PDO_RADAR(const char* arg1) { initial(); setPrimKey (arg1); //read DB record dbAccess = true; dbMessage = readDB(); if ( dbMessage != NULL ) {dbAccess = false;} } char* T_PDO_RADAR:: execute(const char* sql , long* count){ return( db.execute( sql , count ) ); } char* T_PDO_RADAR:: dbCommit(){ return( db.dbCommit( ) ); } char* T_PDO_RADAR:: dbRollback(){ return( db.dbRollback( ) ); } char* T_PDO_RADAR::readDB(){ // DB Trace is off return( db.readDB(*this) ); } char* T_PDO_RADAR::updateDB(){ // DB Trace is off return( db.updateDB(*this) ); } char* T_PDO_RADAR::insertDB(){ // DB Trace is off return( db.insertDB(*this) ); } char* T_PDO_RADAR::deleteDB(){ // DB Trace is off return( db.deleteDB(*this) ); } char* T_PDO_RADAR::deleteDB(const char * where, long* count){ // DB Trace is off return( db.deleteDB( where , count ) ); } char* T_PDO_RADAR::openSetDB(const char * where,const char* order){ // DB Trace is off return( db.openSetDB( where , order ) ); } char* T_PDO_RADAR::countDB(const char * where, long* count){ // DB Trace is off return( db.countDB( where , count ) ); } char* T_PDO_RADAR::getSetDB(){ // DB Trace is off return( db.getSetDB(*this) ); } char* T_PDO_RADAR::closeSetDB(){ // DB Trace is off return( db.closeSetDB() ); } char* T_PDO_RADAR::storeDB(){ char* ret = NULL; setKeysFromRecord(); ret=db.updateDB(*this); if(ret != NULL){ ret=db.insertDB(*this); if(ret != NULL){ dbAccess = false; return(ret); } } return(ret); } // public methode setPrimKey T_PDO_RADAR // // this methode stores the unique key attributes // void T_PDO_RADAR::setPrimKey( const char* arg1 ){ strncpy( (char*)c_k_extId , arg1 , sizeof(c_k_extId) ); c_k_extId[sizeof(c_k_extId)-1] = '\0'; } // end of methode void T_PDO_RADAR::initInsertKeys( const char* arg1 ){ setPrimKey ( arg1); strncpy( (char*)c_extId , arg1 , sizeof(c_extId) ); c_extId[sizeof(c_extId)-1] = '\0'; } // end of methode void T_PDO_RADAR::setKeysFromRecord(){ set_k_extId( extId() ); } // end of methode // //O P E R A T O R + //=================== // T_PDO_RADAR T_PDO_RADAR::operator+(const T_PDO_RADAR &inst) const{ T_PDO_RADAR ptrT_PDO_RADAR(*this); //---------------------------------------------------------- ptrT_PDO_RADAR.set_extId(inst.extId()); //---------------------------------------------------------- if(inst.valueZi() != -1){ ptrT_PDO_RADAR.set_value(inst.value()); ptrT_PDO_RADAR.set_valueZi(inst.valueZi()); } //---------------------------------------------------------- if(inst.TCZi() != -1){ ptrT_PDO_RADAR.set_TC(inst.TC()); ptrT_PDO_RADAR.set_TCZi(inst.TCZi()); } return (ptrT_PDO_RADAR); } // //O P E R A T O R = //=================== // const T_PDO_RADAR& T_PDO_RADAR::operator=(const T_PDO_RADAR &inst){ //---------------------------------------------------------- this->set_extId(inst.extId()); //---------------------------------------------------------- this->set_value(inst.value()); this->set_valueZi(inst.valueZi()); //---------------------------------------------------------- this->set_TC(inst.TC()); this->set_TCZi(inst.TCZi()); return (*this); } // //C O P Y - C O N S T R U C T O R //=================== // T_PDO_RADAR::T_PDO_RADAR(const T_PDO_RADAR &inst){ //---------------------------------------------------------- this->set_extId(inst.extId()); //---------------------------------------------------------- this->set_value(inst.value()); this->set_valueZi(inst.valueZi()); //---------------------------------------------------------- this->set_TC(inst.TC()); this->set_TCZi(inst.TCZi()); } char* T_PDO_RADAR::extId() const{ return((char*)c_extId ); } void T_PDO_RADAR::set_extId( const char* arg ){ strncpy((char*)c_extId , arg , sizeof(c_extId)); c_extId[sizeof(c_extId)-1] = '\0'; return; } char* T_PDO_RADAR::value() const{ return((char*)c_value ); } short T_PDO_RADAR::valueZi() const{ return( s_valueZi); } void T_PDO_RADAR::set_value( const char* arg ){ strncpy((char*)c_value , arg , sizeof(c_value)); c_value[sizeof(c_value)-1] = '\0'; s_valueZi= 0; return; } void T_PDO_RADAR::set_valueZi( short arg ) { s_valueZi = arg; } char* T_PDO_RADAR::TC() const{ return((char*)c_TC ); } short T_PDO_RADAR::TCZi() const{ return( s_TCZi); } void T_PDO_RADAR::set_TC( char* arg ){ strncpy((char*)c_TC , arg , sizeof(c_TC)); c_TC[sizeof(c_TC)-1] = '\0'; s_TCZi= 0; return; } void T_PDO_RADAR::set_TCZi( short arg ) { s_TCZi = arg; } // methodes for Primary key char* T_PDO_RADAR::k_extId(){ return((char*)c_k_extId ); } void T_PDO_RADAR::set_k_extId( char* arg ){ strncpy((char*)c_k_extId , arg , sizeof(c_k_extId)); c_k_extId[sizeof(c_k_extId)-1] = '\0'; return; } // // public methode fillStructure // // this methode filles the classstructue with the private attributes // void T_PDO_RADAR::fillStructure(){ strncpy ( structTable.extId , extId(),sizeof(structTable.extId)); strncpy ( structTable.value , value(),sizeof(structTable.value)); strncpy ( structTable.TC , TC(),sizeof(structTable.TC)); return; } /////////////////////////////////////////////////// void T_PDO_RADAR::fillStructureZi(){ structTableZi.valueZi = valueZi(); structTableZi.TCZi = TCZi(); return; } /////////////////////////////////////////////////// void T_PDO_RADAR::setStructure() { set_value( structTable.value); set_TC( structTable.TC); return; } /////////////////////////////////////////////////// void T_PDO_RADAR::setStructureZi() { set_valueZi( structTableZi.valueZi); set_TCZi( structTableZi.TCZi); return; } /////////////////////////////////////////////////// char* T_PDO_RADAR::getName(){ return((char*)"T_PDO_RADAR"); } /////////////////////////////////////////////////// int T_PDO_RADAR::getSqlCode(){ return( db.dbSqlCode); } int T_PDO_RADAR::getRowsProcessed(){ return( db.dbRowsProcessed); }