408 lines
9.7 KiB
C++
408 lines
9.7 KiB
C++
|
|
// Version: 2014.10.23 15:25:41
|
||
|
|
|
||
|
|
// File: T_TRK_MAP.cpp
|
||
|
|
|
||
|
|
#include "T_TRK_MAP.h"
|
||
|
|
|
||
|
|
T_TRK_MAP::T_TRK_MAP(){
|
||
|
|
// initialise all membervariables
|
||
|
|
initial();
|
||
|
|
}
|
||
|
|
T_TRK_MAP::~T_TRK_MAP(){
|
||
|
|
}
|
||
|
|
void T_TRK_MAP::initial(){
|
||
|
|
// initialise all membervariables
|
||
|
|
set_SectionNo(0);
|
||
|
|
set_InnerId(0);
|
||
|
|
set_InnerIdZi(-1);
|
||
|
|
set_extId("");
|
||
|
|
set_extIdZi(-1);
|
||
|
|
set_CenterFlag(0);
|
||
|
|
set_CenterFlagZi(-1);
|
||
|
|
set_wplen(0);
|
||
|
|
set_wplenZi(-1);
|
||
|
|
set_distance(0);
|
||
|
|
set_distanceZi(-1);
|
||
|
|
set_Description("");
|
||
|
|
set_DescriptionZi(-1);
|
||
|
|
// initialies Primary key members
|
||
|
|
set_k_SectionNo(0);
|
||
|
|
}
|
||
|
|
T_TRK_MAP::T_TRK_MAP(long arg1)
|
||
|
|
{
|
||
|
|
initial();
|
||
|
|
setPrimKey (arg1);
|
||
|
|
//read DB record
|
||
|
|
dbAccess = true;
|
||
|
|
dbMessage = readDB();
|
||
|
|
if ( dbMessage != NULL ) {dbAccess = false;}
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP:: execute(const char* sql , long* count){
|
||
|
|
return( db.execute( sql , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP:: dbCommit(){
|
||
|
|
return( db.dbCommit( ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP:: dbRollback(){
|
||
|
|
return( db.dbRollback( ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP::readDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.readDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP::updateDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.updateDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP::insertDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.insertDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP::deleteDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.deleteDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP::deleteDB(const char * where, long* count){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.deleteDB( where , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP::openSetDB(const char * where,const char* order){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.openSetDB( where , order ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP::countDB(const char * where, long* count){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.countDB( where , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP::getSetDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.getSetDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP::closeSetDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.closeSetDB() );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP::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_TRK_MAP
|
||
|
|
//
|
||
|
|
// this methode stores the unique key attributes
|
||
|
|
//
|
||
|
|
void T_TRK_MAP::setPrimKey( long arg1 ){
|
||
|
|
l_k_SectionNo = arg1;
|
||
|
|
} // end of methode
|
||
|
|
|
||
|
|
void T_TRK_MAP::initInsertKeys( long arg1 ){
|
||
|
|
setPrimKey ( arg1);
|
||
|
|
l_SectionNo = arg1;
|
||
|
|
} // end of methode
|
||
|
|
void T_TRK_MAP::setKeysFromRecord(){
|
||
|
|
set_k_SectionNo( SectionNo() );
|
||
|
|
} // end of methode
|
||
|
|
//
|
||
|
|
//O P E R A T O R +
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
T_TRK_MAP T_TRK_MAP::operator+(const T_TRK_MAP &inst) const{
|
||
|
|
T_TRK_MAP ptrT_TRK_MAP(*this);
|
||
|
|
//----------------------------------------------------------
|
||
|
|
ptrT_TRK_MAP.set_SectionNo(inst.SectionNo());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.InnerIdZi() != -1){
|
||
|
|
ptrT_TRK_MAP.set_InnerId(inst.InnerId());
|
||
|
|
ptrT_TRK_MAP.set_InnerIdZi(inst.InnerIdZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.extIdZi() != -1){
|
||
|
|
ptrT_TRK_MAP.set_extId(inst.extId());
|
||
|
|
ptrT_TRK_MAP.set_extIdZi(inst.extIdZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.CenterFlagZi() != -1){
|
||
|
|
ptrT_TRK_MAP.set_CenterFlag(inst.CenterFlag());
|
||
|
|
ptrT_TRK_MAP.set_CenterFlagZi(inst.CenterFlagZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.wplenZi() != -1){
|
||
|
|
ptrT_TRK_MAP.set_wplen(inst.wplen());
|
||
|
|
ptrT_TRK_MAP.set_wplenZi(inst.wplenZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.distanceZi() != -1){
|
||
|
|
ptrT_TRK_MAP.set_distance(inst.distance());
|
||
|
|
ptrT_TRK_MAP.set_distanceZi(inst.distanceZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.DescriptionZi() != -1){
|
||
|
|
ptrT_TRK_MAP.set_Description(inst.Description());
|
||
|
|
ptrT_TRK_MAP.set_DescriptionZi(inst.DescriptionZi());
|
||
|
|
}
|
||
|
|
return (ptrT_TRK_MAP);
|
||
|
|
}
|
||
|
|
|
||
|
|
//
|
||
|
|
//O P E R A T O R =
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
const T_TRK_MAP& T_TRK_MAP::operator=(const T_TRK_MAP &inst){
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_SectionNo(inst.SectionNo());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_InnerId(inst.InnerId());
|
||
|
|
this->set_InnerIdZi(inst.InnerIdZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_extId(inst.extId());
|
||
|
|
this->set_extIdZi(inst.extIdZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_CenterFlag(inst.CenterFlag());
|
||
|
|
this->set_CenterFlagZi(inst.CenterFlagZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_wplen(inst.wplen());
|
||
|
|
this->set_wplenZi(inst.wplenZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_distance(inst.distance());
|
||
|
|
this->set_distanceZi(inst.distanceZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Description(inst.Description());
|
||
|
|
this->set_DescriptionZi(inst.DescriptionZi());
|
||
|
|
return (*this);
|
||
|
|
}
|
||
|
|
//
|
||
|
|
//C O P Y - C O N S T R U C T O R
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
T_TRK_MAP::T_TRK_MAP(const T_TRK_MAP &inst){
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_SectionNo(inst.SectionNo());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_InnerId(inst.InnerId());
|
||
|
|
this->set_InnerIdZi(inst.InnerIdZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_extId(inst.extId());
|
||
|
|
this->set_extIdZi(inst.extIdZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_CenterFlag(inst.CenterFlag());
|
||
|
|
this->set_CenterFlagZi(inst.CenterFlagZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_wplen(inst.wplen());
|
||
|
|
this->set_wplenZi(inst.wplenZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_distance(inst.distance());
|
||
|
|
this->set_distanceZi(inst.distanceZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Description(inst.Description());
|
||
|
|
this->set_DescriptionZi(inst.DescriptionZi());
|
||
|
|
}
|
||
|
|
long T_TRK_MAP::SectionNo() const{
|
||
|
|
return((long)l_SectionNo );
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_SectionNo( long arg ){
|
||
|
|
l_SectionNo = arg;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
long T_TRK_MAP::InnerId() const{
|
||
|
|
return((long)l_InnerId );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_TRK_MAP::InnerIdZi() const{
|
||
|
|
return( s_InnerIdZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_InnerId( long arg ){
|
||
|
|
l_InnerId = arg;
|
||
|
|
s_InnerIdZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_InnerIdZi( short arg ) {
|
||
|
|
s_InnerIdZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP::extId() const{
|
||
|
|
return((char*)c_extId );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_TRK_MAP::extIdZi() const{
|
||
|
|
return( s_extIdZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_extId( const char* arg ){
|
||
|
|
strncpy((char*)c_extId , arg , sizeof(c_extId));
|
||
|
|
c_extId[sizeof(c_extId)-1] = '\0';
|
||
|
|
s_extIdZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_extIdZi( short arg ) {
|
||
|
|
s_extIdZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
long T_TRK_MAP::CenterFlag() const{
|
||
|
|
return((long)l_CenterFlag );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_TRK_MAP::CenterFlagZi() const{
|
||
|
|
return( s_CenterFlagZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_CenterFlag( long arg ){
|
||
|
|
l_CenterFlag = arg;
|
||
|
|
s_CenterFlagZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_CenterFlagZi( short arg ) {
|
||
|
|
s_CenterFlagZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
long T_TRK_MAP::wplen() const{
|
||
|
|
return((long)l_wplen );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_TRK_MAP::wplenZi() const{
|
||
|
|
return( s_wplenZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_wplen( long arg ){
|
||
|
|
l_wplen = arg;
|
||
|
|
s_wplenZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_wplenZi( short arg ) {
|
||
|
|
s_wplenZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
long T_TRK_MAP::distance() const{
|
||
|
|
return((long)l_distance );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_TRK_MAP::distanceZi() const{
|
||
|
|
return( s_distanceZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_distance( long arg ){
|
||
|
|
l_distance = arg;
|
||
|
|
s_distanceZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_distanceZi( short arg ) {
|
||
|
|
s_distanceZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_MAP::Description() const{
|
||
|
|
return((char*)c_Description );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_TRK_MAP::DescriptionZi() const{
|
||
|
|
return( s_DescriptionZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_Description( const char* arg ){
|
||
|
|
strncpy((char*)c_Description , arg , sizeof(c_Description));
|
||
|
|
c_Description[sizeof(c_Description)-1] = '\0';
|
||
|
|
s_DescriptionZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_DescriptionZi( short arg ) {
|
||
|
|
s_DescriptionZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
// methodes for Primary key
|
||
|
|
long T_TRK_MAP::k_SectionNo(){
|
||
|
|
return((long)l_k_SectionNo );
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_MAP::set_k_SectionNo( long arg ){
|
||
|
|
l_k_SectionNo = arg;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
//
|
||
|
|
// public methode fillStructure
|
||
|
|
//
|
||
|
|
// this methode filles the classstructue with the private attributes
|
||
|
|
//
|
||
|
|
void T_TRK_MAP::fillStructure(){
|
||
|
|
structTable.SectionNo = SectionNo();
|
||
|
|
structTable.InnerId = InnerId();
|
||
|
|
strncpy ( structTable.extId , extId(),sizeof(structTable.extId));
|
||
|
|
structTable.CenterFlag = CenterFlag();
|
||
|
|
structTable.wplen = wplen();
|
||
|
|
structTable.distance = distance();
|
||
|
|
strncpy ( structTable.Description , Description(),sizeof(structTable.Description));
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_TRK_MAP::fillStructureZi(){
|
||
|
|
structTableZi.InnerIdZi = InnerIdZi();
|
||
|
|
structTableZi.extIdZi = extIdZi();
|
||
|
|
structTableZi.CenterFlagZi = CenterFlagZi();
|
||
|
|
structTableZi.wplenZi = wplenZi();
|
||
|
|
structTableZi.distanceZi = distanceZi();
|
||
|
|
structTableZi.DescriptionZi = DescriptionZi();
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_TRK_MAP::setStructure() {
|
||
|
|
set_InnerId( structTable.InnerId);
|
||
|
|
set_extId( structTable.extId);
|
||
|
|
set_CenterFlag( structTable.CenterFlag);
|
||
|
|
set_wplen( structTable.wplen);
|
||
|
|
set_distance( structTable.distance);
|
||
|
|
set_Description( structTable.Description);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_TRK_MAP::setStructureZi() {
|
||
|
|
set_InnerIdZi( structTableZi.InnerIdZi);
|
||
|
|
set_extIdZi( structTableZi.extIdZi);
|
||
|
|
set_CenterFlagZi( structTableZi.CenterFlagZi);
|
||
|
|
set_wplenZi( structTableZi.wplenZi);
|
||
|
|
set_distanceZi( structTableZi.distanceZi);
|
||
|
|
set_DescriptionZi( structTableZi.DescriptionZi);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
char* T_TRK_MAP::getName(){
|
||
|
|
return("T_TRK_MAP");
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
int T_TRK_MAP::getSqlCode(){
|
||
|
|
return( db.dbSqlCode);
|
||
|
|
}
|
||
|
|
int T_TRK_MAP::getRowsProcessed(){
|
||
|
|
return( db.dbRowsProcessed);
|
||
|
|
}
|