425 lines
7.3 KiB
C++
425 lines
7.3 KiB
C++
// Version: 2018.8.14 9:25:19
|
|
|
|
#ifndef _T_TEL_RECV_H
|
|
#define _T_TEL_RECV_H
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#ifdef _MSC_VER
|
|
#pragma warning(disable:4996)
|
|
#pragma warning(disable:4267)
|
|
#endif
|
|
#include "T_TEL_RECVDBAX.h"
|
|
class T_TEL_RECV{
|
|
friend class T_TEL_RECVDBAX;
|
|
private:
|
|
//aggregation to DB Class
|
|
T_TEL_RECVDBAX 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
|
|
//===================
|
|
//
|
|
long l_seq;
|
|
char c_RcvTime[27];
|
|
short s_RcvTimeZi;
|
|
long l_Counter;
|
|
long l_accessFlag;
|
|
char c_teleId[6+1];
|
|
char c_extId[20+1];
|
|
long l_eventno;
|
|
char c_sender[10+1];
|
|
short s_senderZi;
|
|
char c_telegramData[4000+1];
|
|
long l_telegramLength;
|
|
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_TEL_RECV{
|
|
int seq;
|
|
char RcvTime[27];
|
|
int Counter;
|
|
int accessFlag;
|
|
char teleId[6+1];
|
|
char extId[20+1];
|
|
int eventno;
|
|
char sender[10+1];
|
|
char telegramData[4000+1];
|
|
int telegramLength;
|
|
char toc[27];
|
|
char tom[27];
|
|
char mop[121];
|
|
char mou[31];
|
|
}structTable;
|
|
// LTA Structure Zi
|
|
struct STR_T_TEL_RECVZi{
|
|
short RcvTimeZi;
|
|
short senderZi;
|
|
short tocZi;
|
|
short tomZi;
|
|
short mopZi;
|
|
short mouZi;
|
|
}structTableZi;
|
|
//
|
|
//C O N S T R U C T O R S
|
|
//=======================
|
|
//
|
|
public:
|
|
T_TEL_RECV();
|
|
//D E S T R U C T O R S
|
|
//=======================
|
|
//
|
|
virtual ~T_TEL_RECV();
|
|
//
|
|
//C O P Y - C O N S T R U C T O R
|
|
//=======================
|
|
T_TEL_RECV(const T_TEL_RECV &inst);
|
|
// For Constructors with parameters the flag dbAccess
|
|
// informs you if the access was successfully or not
|
|
T_TEL_RECV( long arg1);
|
|
|
|
//methods
|
|
public:
|
|
char* getCreationTime() {return (char*)"2018.8.14 9:25:19";};
|
|
//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_TEL_RECV operator+(const T_TEL_RECV &inst) const;
|
|
|
|
//
|
|
//O P E R A T O R =
|
|
//===================
|
|
//
|
|
public:
|
|
const T_TEL_RECV& operator=(const T_TEL_RECV &inst);
|
|
long seq() const;//{
|
|
//return((long)l_seq );
|
|
//}
|
|
|
|
|
|
void set_seq( long arg );//{
|
|
//l_seq = arg;
|
|
//return;
|
|
//}
|
|
|
|
|
|
char* RcvTime() const;//{
|
|
//return((char*)c_RcvTime );
|
|
//}
|
|
|
|
short RcvTimeZi() const;//{
|
|
//return( s_RcvTimeZi);
|
|
//}
|
|
|
|
void set_RcvTime( char* arg );//{
|
|
//strncpy((char*)c_RcvTime , arg , sizeof(c_RcvTime));
|
|
//c_RcvTime[sizeof(c_RcvTime)-1] = '\0';
|
|
//s_RcvTimeZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_RcvTimeZi( short arg ) ;//{
|
|
//s_RcvTimeZi = arg;
|
|
//}
|
|
|
|
long Counter() const;//{
|
|
//return((long)l_Counter );
|
|
//}
|
|
|
|
|
|
void set_Counter( long arg );//{
|
|
//l_Counter = arg;
|
|
//return;
|
|
//}
|
|
|
|
|
|
long accessFlag() const;//{
|
|
//return((long)l_accessFlag );
|
|
//}
|
|
|
|
|
|
void set_accessFlag( long arg );//{
|
|
//l_accessFlag = arg;
|
|
//return;
|
|
//}
|
|
|
|
|
|
char* teleId() const;//{
|
|
//return((char*)c_teleId );
|
|
//}
|
|
|
|
|
|
void set_teleId( const char* arg );//{
|
|
//strncpy((char*)c_teleId , arg , sizeof(c_teleId));
|
|
//c_teleId[sizeof(c_teleId)-1] = '\0';
|
|
//return;
|
|
//}
|
|
|
|
|
|
char* extId() const;//{
|
|
//return((char*)c_extId );
|
|
//}
|
|
|
|
|
|
void set_extId( const char* arg );//{
|
|
//strncpy((char*)c_extId , arg , sizeof(c_extId));
|
|
//c_extId[sizeof(c_extId)-1] = '\0';
|
|
//return;
|
|
//}
|
|
|
|
|
|
long eventno() const;//{
|
|
//return((long)l_eventno );
|
|
//}
|
|
|
|
|
|
void set_eventno( long arg );//{
|
|
//l_eventno = arg;
|
|
//return;
|
|
//}
|
|
|
|
|
|
char* sender() const;//{
|
|
//return((char*)c_sender );
|
|
//}
|
|
|
|
short senderZi() const;//{
|
|
//return( s_senderZi);
|
|
//}
|
|
|
|
void set_sender( const char* arg );//{
|
|
//strncpy((char*)c_sender , arg , sizeof(c_sender));
|
|
//c_sender[sizeof(c_sender)-1] = '\0';
|
|
//s_senderZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_senderZi( short arg ) ;//{
|
|
//s_senderZi = arg;
|
|
//}
|
|
|
|
char* telegramData() const;//{
|
|
//return((char*)c_telegramData );
|
|
//}
|
|
|
|
|
|
void set_telegramData( const char* arg );//{
|
|
//strncpy((char*)c_telegramData , arg , sizeof(c_telegramData));
|
|
//c_telegramData[sizeof(c_telegramData)-1] = '\0';
|
|
//return;
|
|
//}
|
|
|
|
|
|
long telegramLength() const;//{
|
|
//return((long)l_telegramLength );
|
|
//}
|
|
|
|
|
|
void set_telegramLength( long arg );//{
|
|
//l_telegramLength = arg;
|
|
//return;
|
|
//}
|
|
|
|
|
|
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_TEL_RECV");
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getSqlCode();//{
|
|
//return( db.dbSqlCode);
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getRowsProcessed();//{
|
|
//return( db.dbRowsProcessed);
|
|
//}
|
|
};
|
|
#endif
|