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.
68 lines
2.1 KiB
68 lines
2.1 KiB
#ifndef __BASICCOMMUNICATIONPROTOCOL_H_INCL__
|
|
#define __BASICCOMMUNICATIONPROTOCOL_H_INCL__
|
|
|
|
#include "basicEvtDispatcher.h"
|
|
#include "basicCommunicationTransport.h"
|
|
/**
|
|
* TODO: Add class description
|
|
*
|
|
* @author gagua
|
|
*/
|
|
class basicCommunicationProtocol {
|
|
protected:
|
|
int m_iTypeID;
|
|
bool m_bTransportIsBound;
|
|
basicCommunicationTransport *m_pChannel;
|
|
public:
|
|
// Constructor
|
|
basicCommunicationProtocol();
|
|
|
|
// Destructor
|
|
virtual ~basicCommunicationProtocol();
|
|
|
|
// Copy constructor
|
|
// TODO: Uncomment the copy constructor when you need it.
|
|
//basicCommunicationProtocol(const basicCommunicationProtocol& src);
|
|
|
|
// Assignment operator
|
|
// TODO: Uncomment the assignment operator when you need it.
|
|
//basicCommunicationProtocol& operator=(const basicCommunicationProtocol& src);
|
|
virtual int probeData( unsigned char *Data, int DataSize ){};
|
|
virtual int parseData( unsigned char *Data, int DataSize ){};
|
|
virtual bool getPackage( unsigned char *Data, int DataSize ){ return NULL;};
|
|
virtual void sendPackage( unsigned char *Data, int DataSize ){};
|
|
bool bindToCommunicationChannel( basicCommunicationTransport *Channel );
|
|
};
|
|
|
|
typedef std::vector< basicCommunicationProtocol > ProtocolQueue;
|
|
typedef std::vector< basicCommunicationProtocol *> pProtocolQueue;
|
|
|
|
// Constructor implementation
|
|
inline basicCommunicationProtocol::basicCommunicationProtocol(){
|
|
m_bTransportIsBound = false;
|
|
m_pChannel = NULL;
|
|
};
|
|
|
|
// Destructor implementation
|
|
inline basicCommunicationProtocol::~basicCommunicationProtocol(){
|
|
};
|
|
|
|
// TODO: Uncomment the copy constructor when you need it.
|
|
//inline basicCommunicationProtocol::basicCommunicationProtocol(const basicCommunicationProtocol& src)
|
|
//{
|
|
// // TODO: copy
|
|
//}
|
|
|
|
// TODO: Uncomment the assignment operator when you need it.
|
|
//inline basicCommunicationProtocol& basicCommunicationProtocol::operator=(const basicCommunicationProtocol& rhs)
|
|
//{
|
|
// if (this == &rhs) {
|
|
// return *this;
|
|
// }
|
|
//
|
|
// // TODO: assignment
|
|
//
|
|
// return *this;
|
|
//}
|
|
|
|
#endif // __BASICCOMMUNICATIONPROTOCOL_H_INCL__
|