21 lines
600 B
C
21 lines
600 B
C
|
#ifndef _COMMUNICATOR_INCLUDED_
|
||
|
#define _COMMUNICATOR_INCLUDED_
|
||
|
|
||
|
class Communicator
|
||
|
{
|
||
|
protected:
|
||
|
char *messageBuffer;
|
||
|
__SIZE_TYPE__ bufferSize;
|
||
|
__SIZE_TYPE__ calculateMessageOutSize(__SIZE_TYPE__ numberOfValues);
|
||
|
void parseIDs(const int values[], __SIZE_TYPE__ numberOfValues, char *out);
|
||
|
|
||
|
public:
|
||
|
Communicator(__SIZE_TYPE__ bufferSize);
|
||
|
virtual void sendMessage(int *values, __SIZE_TYPE__ numberOfValues);
|
||
|
virtual void sendMessage(const char message[]);
|
||
|
virtual char *receiveMessage();
|
||
|
char *getBuffer();
|
||
|
void clearBuffer();
|
||
|
int getBufferSize();
|
||
|
};
|
||
|
#endif
|