You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
#ifndef __BASIC_TNSPORT_HEADERS__
|
|
#define __BASIC_TNSPORT_HEADERS__
|
|
|
|
#include <vector>
|
|
#include <algorithm>
|
|
|
|
#include "basicMutex.h"
|
|
|
|
#include "basicLogCollection.h"
|
|
|
|
#ifdef DEBUG
|
|
//#ifndef DUBUG_COMMUNICATION
|
|
//#define DUBUG_COMMUNICATION
|
|
//#endif
|
|
#endif
|
|
|
|
class protocolParser;
|
|
|
|
typedef std::vector<protocolParser *> parseQueue;
|
|
|
|
class basicTransport{
|
|
private:
|
|
basicLogCollection * m_pLog;
|
|
protected:
|
|
parseQueue m_vParsers;
|
|
basicMutex m_mQueueProtectorMutex;
|
|
basicMutex m_mBufferProtectorMutex;
|
|
|
|
CONNECTION_STATUS m_eConnectionStatus;
|
|
public:
|
|
basicTransport();
|
|
~basicTransport();
|
|
virtual bool sendData(unsigned char *Data, int DataSize){ return true; };
|
|
virtual bool reconnect( void ){ return false; };
|
|
bool addRecipient( protocolParser *ProtoParser );
|
|
bool removeRecipient( protocolParser *ProtoParser );
|
|
bool getStatus( void ){ return m_eConnectionStatus == CS_CONNECTED; };
|
|
void setConnectionStatus( CONNECTION_STATUS ES);
|
|
CONNECTION_STATUS getConnectionStatus( void );
|
|
};
|
|
|
|
#endif
|