35 #include "akglogging.hh"
36 #include "rnpexception.hh"
38 #define AKGLOGLN(a,b,c)
48 #define RNP_DEFAULTBUFFERSIZE 1024
132 static RnpQuark
swapBytes(RnpQuark) throw();
136 static AkgLogConnection logConn;
208 RnpParameter* getNextParameter()
const throw();
211 void* getData() const throw();
214 RnpQuark getDataLength() const throw();
220 void changeToHostEndianness() throw();
221 void changeToPartnerEndianness() throw();
223 RnpQuark computeTotalAlignedLength() throw();
224 RnpQuark getPaddLength() const throw();
245 RnpFragmentHeader* getNextFragment()
const throw();
248 RnpParameter* getFirstParameter() const throw();
268 RnpProtocolEncoder()
throw();
270 ~RnpProtocolEncoder()
throw();
276 bool allocateBuffer(
int maxMessageLength)
throw();
281 bool adjustBufferSize(
int differenceSize)
throw();
283 int getBufferSize()
throw();
294 void startMessage(RnpQuark serverType,
int carrierHeaderSize = 0)
throw();
311 void addStringParameter(RnpQuark parameterType,
const char*)
throw();
314 void addInt32Parameter(RnpQuark parameterType,
int)
throw();
317 void addFloat32Parameter(RnpQuark parameterType,
float)
throw();
320 void addDouble64Parameter(RnpQuark parameterType,
double)
throw();
323 void addOpaqueParameter(RnpQuark parameterType,
const void*,
int size)
throw();
326 void endFragment()
throw();
332 int getCarrierHeaderSize()
throw();
341 void addParameter(RnpQuark parameterType,
Rnp::DataType,
const void *data,
int length)
throw();
347 int carrierHeaderSize;
348 Rnp::Endianness finalEndianness;
351 RnpFragmentHeader *currFragment;
352 RnpParameter *currParameter;
366 RnpProtocolDecoder()
throw();
377 RnpQuark getDestinationServerType()
const throw();
386 int getMessageLength()
const throw();
389 int getMessageVersion()
const throw();
392 RnpQuark countFragments()
const throw();
398 const RnpFragmentHeader* getNextFragment()
const throw();
401 RnpQuark getFragmentType()
const throw();
404 const char* getFragmentTypeName()
const throw();
410 int countParameters()
const throw();
413 RnpQuark getFragmentLength()
const throw();
416 const RnpParameter* getFirstParameter()
const throw();
419 const RnpParameter* getNextParameter()
const throw();
422 RnpQuark getParameterType()
const throw();
425 RnpQuark getDataType()
const throw();
428 const void* getData()
const throw();
431 const char* getDataAsString()
const throw();
434 int getDataAsInteger()
const throw();
437 float getDataAsFloat()
const throw();
440 double getDataAsDouble()
const throw();
443 const void* getDataAsOpaque()
const throw();
446 int getDataLength()
const throw();
452 mutable RnpFragmentHeader *currFragment;
453 mutable int currFragmentIdx;
455 mutable RnpParameter *currParameter;
456 mutable int currParameterIdx;
459 void printRnpHeader(
RnpHeader*)
const throw();
462 bool testIntegrity()
const throw();
469 bool changeToHostEndianness()
throw();
Definition: rnprotocol.hh:78
static const char * getDataTypeName(RnpQuark)
Definition: rnprotocol.hh:103
Definition: rnprotocol.hh:114
Definition: rnprotocol.hh:59
Definition: rnprotocol.hh:90
int RnpQuark
The basic type used in RNP. It is always 32-bit long.
Definition: rnprotocol.hh:51
static RnpQuark swapBytes(RnpQuark)
Helper functions for endianness.
Definition: rnprotocol.hh:264
Definition: rnprotocol.hh:70
Definition: rnprotocol.hh:362
ErrorType
Definition: rnprotocol.hh:99
Definition: rnprotocol.hh:104
Definition: rnprotocol.hh:91
FragmentType
Definition: rnprotocol.hh:73
Definition: rnprotocol.hh:192
Definition: rnprotocol.hh:82
RnpQuark paramType
The logical type of the parameter. Server dependent.
Definition: rnprotocol.hh:195
static const char * getErrorTypeName(RnpQuark)
DataType
Definition: rnprotocol.hh:84
static Endianness detectHostEndianness()
Definition: rnpcommunication.hh:44
static const char * getEndiannessName(Endianness)
static const char * undefValue
Arrays containing the names of the various elements.
Definition: rnprotocol.hh:141
Definition: rnprotocol.hh:112
Definition: rnprotocol.hh:101
Definition: rnprotocol.hh:77
Definition: rnprotocol.hh:86
ErrorParam
Definition: rnprotocol.hh:109
static const RnpQuark rnpProtocolId
Definition: rnprotocol.hh:65
static const char * errorTypeNames[ert_HowMany]
Definition: rnprotocol.hh:145
akg::CommBuffer * commBuffer
Definition: rnprotocol.hh:336
Definition: rnprotocol.hh:89
Definition: rnprotocol.hh:106
Definition: rnprotocol.hh:69
static const char * dataTypeNames[dtt_HowMany]
Definition: rnprotocol.hh:144
Definition: rnprotocol.hh:76
RnpQuark dataType
The data type of the parameter. One of Rnp::DataType.
Definition: rnprotocol.hh:198
static const char * getErrorParamName(RnpQuark)
Definition: rnprotocol.hh:102
RnpQuark totalLength
Total length of teh parameter, header + data + alignment bytes.
Definition: rnprotocol.hh:205
RnpQuark dataLength
The length of the data.
Definition: rnprotocol.hh:201
Definition: rnprotocol.hh:88
Definition: rnprotocol.hh:111
static const char * errorParamNames[erp_HowMany]
Definition: rnprotocol.hh:146
static const char * getFragmentTypeName(RnpQuark)
Functions to get the names of the various elements.
Definition: rnprotocol.hh:79
Definition: rnprotocol.hh:95
Definition: rnprotocol.hh:92
Endianness
Definition: rnprotocol.hh:67
Definition: rnprotocol.hh:116
static const char * fragmentTypeNames[fgt_HowMany]
Definition: rnprotocol.hh:143
Definition: rnprotocol.hh:113
virtual const char * getCommandName(RnpQuark) const =0
Definition: akgnet_commbuffer.hh:57
Definition: rnprotocol.hh:75
virtual const char * getParameterTypeName(RnpQuark) const =0
Definition: rnprotocol.hh:87
static const char * endiannessNames[2]
Definition: rnprotocol.hh:142