eis/src/dbax/T_LOV_SPM1.cpp

439 lines
10 KiB
C++
Raw Normal View History

// Version: 2015.3.5 10:29:43
// File: T_LOV_SPM1.cpp
#include "T_LOV_SPM1.h"
T_LOV_SPM1::T_LOV_SPM1(){
// initialise all membervariables
initial();
}
T_LOV_SPM1::~T_LOV_SPM1(){
}
void T_LOV_SPM1::initial(){
// initialise all membervariables
set_SGCode(0);
set_ThickMax(0);
set_ThickMin(0);
set_RollingForce(0.0);
set_RollingForceZi(-1);
set_toc("");
set_tocZi(-1);
set_tom("");
set_tomZi(-1);
set_mop("");
set_mopZi(-1);
set_mou("");
set_mouZi(-1);
// initialies Primary key members
set_k_SGCode(0);
set_k_ThickMax(0);
set_k_ThickMin(0);
}
T_LOV_SPM1::T_LOV_SPM1(long arg1,long arg2,long arg3)
{
initial();
setPrimKey (arg1, arg2, arg3);
//read DB record
dbAccess = true;
dbMessage = readDB();
if ( dbMessage != NULL ) {dbAccess = false;}
}
char* T_LOV_SPM1:: execute(const char* sql , long* count){
return( db.execute( sql , count ) );
}
char* T_LOV_SPM1:: dbCommit(){
return( db.dbCommit( ) );
}
char* T_LOV_SPM1:: dbRollback(){
return( db.dbRollback( ) );
}
char* T_LOV_SPM1::readDB(){
// DB Trace is off
return( db.readDB(*this) );
}
char* T_LOV_SPM1::updateDB(){
// DB Trace is off
return( db.updateDB(*this) );
}
char* T_LOV_SPM1::insertDB(){
// DB Trace is off
return( db.insertDB(*this) );
}
char* T_LOV_SPM1::deleteDB(){
// DB Trace is off
return( db.deleteDB(*this) );
}
char* T_LOV_SPM1::deleteDB(const char * where, long* count){
// DB Trace is off
return( db.deleteDB( where , count ) );
}
char* T_LOV_SPM1::openSetDB(const char * where,const char* order){
// DB Trace is off
return( db.openSetDB( where , order ) );
}
char* T_LOV_SPM1::countDB(const char * where, long* count){
// DB Trace is off
return( db.countDB( where , count ) );
}
char* T_LOV_SPM1::getSetDB(){
// DB Trace is off
return( db.getSetDB(*this) );
}
char* T_LOV_SPM1::closeSetDB(){
// DB Trace is off
return( db.closeSetDB() );
}
char* T_LOV_SPM1::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_LOV_SPM1
//
// this methode stores the unique key attributes
//
void T_LOV_SPM1::setPrimKey( long arg1 , long arg2 , long arg3 ){
l_k_SGCode = arg1;
l_k_ThickMax = arg2;
l_k_ThickMin = arg3;
} // end of methode
void T_LOV_SPM1::initInsertKeys( long arg1 , long arg2 , long arg3 ){
setPrimKey ( arg1 , arg2 , arg3);
l_SGCode = arg1;
l_ThickMax = arg2;
l_ThickMin = arg3;
} // end of methode
void T_LOV_SPM1::setKeysFromRecord(){
set_k_SGCode( SGCode() );
set_k_ThickMax( ThickMax() );
set_k_ThickMin( ThickMin() );
} // end of methode
//
//O P E R A T O R +
//===================
//
T_LOV_SPM1 T_LOV_SPM1::operator+(const T_LOV_SPM1 &inst) const{
T_LOV_SPM1 ptrT_LOV_SPM1(*this);
//----------------------------------------------------------
ptrT_LOV_SPM1.set_SGCode(inst.SGCode());
//----------------------------------------------------------
ptrT_LOV_SPM1.set_ThickMax(inst.ThickMax());
//----------------------------------------------------------
ptrT_LOV_SPM1.set_ThickMin(inst.ThickMin());
//----------------------------------------------------------
if(inst.RollingForceZi() != -1){
ptrT_LOV_SPM1.set_RollingForce(inst.RollingForce());
ptrT_LOV_SPM1.set_RollingForceZi(inst.RollingForceZi());
}
//----------------------------------------------------------
if(inst.tocZi() != -1){
ptrT_LOV_SPM1.set_toc(inst.toc());
ptrT_LOV_SPM1.set_tocZi(inst.tocZi());
}
//----------------------------------------------------------
if(inst.tomZi() != -1){
ptrT_LOV_SPM1.set_tom(inst.tom());
ptrT_LOV_SPM1.set_tomZi(inst.tomZi());
}
//----------------------------------------------------------
if(inst.mopZi() != -1){
ptrT_LOV_SPM1.set_mop(inst.mop());
ptrT_LOV_SPM1.set_mopZi(inst.mopZi());
}
//----------------------------------------------------------
if(inst.mouZi() != -1){
ptrT_LOV_SPM1.set_mou(inst.mou());
ptrT_LOV_SPM1.set_mouZi(inst.mouZi());
}
return (ptrT_LOV_SPM1);
}
//
//O P E R A T O R =
//===================
//
const T_LOV_SPM1& T_LOV_SPM1::operator=(const T_LOV_SPM1 &inst){
//----------------------------------------------------------
this->set_SGCode(inst.SGCode());
//----------------------------------------------------------
this->set_ThickMax(inst.ThickMax());
//----------------------------------------------------------
this->set_ThickMin(inst.ThickMin());
//----------------------------------------------------------
this->set_RollingForce(inst.RollingForce());
this->set_RollingForceZi(inst.RollingForceZi());
//----------------------------------------------------------
this->set_toc(inst.toc());
this->set_tocZi(inst.tocZi());
//----------------------------------------------------------
this->set_tom(inst.tom());
this->set_tomZi(inst.tomZi());
//----------------------------------------------------------
this->set_mop(inst.mop());
this->set_mopZi(inst.mopZi());
//----------------------------------------------------------
this->set_mou(inst.mou());
this->set_mouZi(inst.mouZi());
return (*this);
}
//
//C O P Y - C O N S T R U C T O R
//===================
//
T_LOV_SPM1::T_LOV_SPM1(const T_LOV_SPM1 &inst){
//----------------------------------------------------------
this->set_SGCode(inst.SGCode());
//----------------------------------------------------------
this->set_ThickMax(inst.ThickMax());
//----------------------------------------------------------
this->set_ThickMin(inst.ThickMin());
//----------------------------------------------------------
this->set_RollingForce(inst.RollingForce());
this->set_RollingForceZi(inst.RollingForceZi());
//----------------------------------------------------------
this->set_toc(inst.toc());
this->set_tocZi(inst.tocZi());
//----------------------------------------------------------
this->set_tom(inst.tom());
this->set_tomZi(inst.tomZi());
//----------------------------------------------------------
this->set_mop(inst.mop());
this->set_mopZi(inst.mopZi());
//----------------------------------------------------------
this->set_mou(inst.mou());
this->set_mouZi(inst.mouZi());
}
long T_LOV_SPM1::SGCode() const{
return((long)l_SGCode );
}
void T_LOV_SPM1::set_SGCode( long arg ){
l_SGCode = arg;
return;
}
long T_LOV_SPM1::ThickMax() const{
return((long)l_ThickMax );
}
void T_LOV_SPM1::set_ThickMax( long arg ){
l_ThickMax = arg;
return;
}
long T_LOV_SPM1::ThickMin() const{
return((long)l_ThickMin );
}
void T_LOV_SPM1::set_ThickMin( long arg ){
l_ThickMin = arg;
return;
}
double T_LOV_SPM1::RollingForce() const{
return((double)d_RollingForce );
}
short T_LOV_SPM1::RollingForceZi() const{
return( s_RollingForceZi);
}
void T_LOV_SPM1::set_RollingForce( double arg ){
d_RollingForce = arg;
s_RollingForceZi= 0;
return;
}
void T_LOV_SPM1::set_RollingForceZi( short arg ) {
s_RollingForceZi = arg;
}
char* T_LOV_SPM1::toc() const{
return((char*)c_toc );
}
short T_LOV_SPM1::tocZi() const{
return( s_tocZi);
}
void T_LOV_SPM1::set_toc( char* arg ){
strncpy((char*)c_toc , arg , sizeof(c_toc));
c_toc[sizeof(c_toc)-1] = '\0';
s_tocZi= 0;
return;
}
void T_LOV_SPM1::set_tocZi( short arg ){
s_tocZi = arg;
}
char* T_LOV_SPM1::tom() const{
return((char*)c_tom );
}
short T_LOV_SPM1::tomZi() const{
return( s_tomZi);
}
void T_LOV_SPM1::set_tom( char* arg ){
strncpy((char*)c_tom , arg , sizeof(c_tom));
c_tom[sizeof(c_tom)-1] = '\0';
s_tomZi= 0;
return;
}
void T_LOV_SPM1::set_tomZi( short arg ){
s_tomZi = arg;
}
char* T_LOV_SPM1::mop() const{
return((char*)c_mop );
}
short T_LOV_SPM1::mopZi() const{
return( s_mopZi);
}
void T_LOV_SPM1::set_mop( char* arg ){
strncpy((char*)c_mop , arg , sizeof(c_mop));
c_mop[sizeof(c_mop)-1] = '\0';
s_mopZi= 0;
return;
}
void T_LOV_SPM1::set_mopZi( short arg ){
s_mopZi = arg;
}
char* T_LOV_SPM1::mou() const{
return((char*)c_mou );
}
short T_LOV_SPM1::mouZi() const{
return( s_mouZi);
}
void T_LOV_SPM1::set_mou( char* arg ){
strncpy((char*)c_mou , arg , sizeof(c_mou));
c_mou[sizeof(c_mou)-1] = '\0';
s_mouZi= 0;
return;
}
void T_LOV_SPM1::set_mouZi( short arg ){
s_mouZi = arg;
}
// methodes for Primary key
long T_LOV_SPM1::k_SGCode(){
return((long)l_k_SGCode );
}
void T_LOV_SPM1::set_k_SGCode( long arg ){
l_k_SGCode = arg;
return;
}
long T_LOV_SPM1::k_ThickMax(){
return((long)l_k_ThickMax );
}
void T_LOV_SPM1::set_k_ThickMax( long arg ){
l_k_ThickMax = arg;
return;
}
long T_LOV_SPM1::k_ThickMin(){
return((long)l_k_ThickMin );
}
void T_LOV_SPM1::set_k_ThickMin( long arg ){
l_k_ThickMin = arg;
return;
}
//
// public methode fillStructure
//
// this methode filles the classstructue with the private attributes
//
void T_LOV_SPM1::fillStructure(){
structTable.SGCode = SGCode();
structTable.ThickMax = ThickMax();
structTable.ThickMin = ThickMin();
structTable.RollingForce = RollingForce();
strncpy ( structTable.toc , toc(),sizeof(structTable.toc));
strncpy ( structTable.tom , tom(),sizeof(structTable.tom));
strncpy ( structTable.mop , mop(),sizeof(structTable.mop));
strncpy ( structTable.mou , mou(),sizeof(structTable.mou));
return;
}
///////////////////////////////////////////////////
void T_LOV_SPM1::fillStructureZi(){
structTableZi.RollingForceZi = RollingForceZi();
structTableZi.tocZi = tocZi();
structTableZi.tomZi = tomZi();
structTableZi.mopZi = mopZi();
structTableZi.mouZi = mouZi();
return;
}
///////////////////////////////////////////////////
void T_LOV_SPM1::setStructure() {
set_RollingForce( structTable.RollingForce);
set_toc(structTable.toc);
set_tom(structTable.tom);
set_mop(structTable.mop);
set_mou(structTable.mou);
return;
}
///////////////////////////////////////////////////
void T_LOV_SPM1::setStructureZi() {
set_RollingForceZi( structTableZi.RollingForceZi);
set_tocZi(structTableZi.tocZi);
set_tomZi(structTableZi.tomZi);
set_mopZi(structTableZi.mopZi);
set_mouZi(structTableZi.mouZi);
return;
}
///////////////////////////////////////////////////
char* T_LOV_SPM1::getName(){
return("T_LOV_SPM1");
}
///////////////////////////////////////////////////
int T_LOV_SPM1::getSqlCode(){
return( db.dbSqlCode);
}
int T_LOV_SPM1::getRowsProcessed(){
return( db.dbRowsProcessed);
}