Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

ztt::dcs::FeePacket Class Reference

#include <FeePacket.hpp>

List of all members.


Detailed Description

This class covers the work for marshalling and unmarshalling the command, send down to the DIM-Server.

Author:
Christian Kofler, Sebastian Bablok, Eric Conner


Public Member Functions

 FeePacket (short errorCode, char *payload, int payloadSize, bool checksum=false, FlagBits flags=NO_FLAGS, bool huffman=false)
 FeePacket (short errorCode, char *payload, int payloadSize, std::vector< char * > *feeContainer, bool checksum=false, FlagBits flags=NO_FLAGS, bool huffman=false)
 FeePacket (std::vector< char * > *feeContainer, int numberofTags=1)
 ~FeePacket ()
unsigned int getId () const
short getErrorCode () const
int getPayloadSize () const
int getFeePacketSize () const
FlagBits getFlags () const
bool isHuffmanSet () const
bool isChecksumSet () const
bool isValid () const
char * getPayload () const
char * marshall ()
void increaseID ()
std::map< int, char * > getAnswerSet ()

Static Public Member Functions

FeePacketunmarshall (char *marshalledFeePacket, int size)

Public Attributes

std::vector< char * > feeServerNames


Constructor & Destructor Documentation

ztt::dcs::FeePacket::FeePacket short  errorCode,
char *  payload,
int  payloadSize,
bool  checksum = false,
FlagBits  flags = NO_FLAGS,
bool  huffman = false
 

Constructor for a command. If the huffman-flag is set, the payload will be coded in huffman here in the constructor due to consistency of the payload size member. This means: the payload and payloadSize differs from the input in the constructor afterwards. The ID for the FeePacket is set inside this constructor.

Parameters:
errorCode the errorCode in the header of the command
payload the payload of the command to be send
payloadSize the size of the payload in bytes
checksum indicates, if checksum-flag is or will be set (depends on marshall or unmarshall, by default this flag is set to false)
flags flags contains flag bits, indicating commands to feeserver (by default this flag is set to NO_FLAGS)
huffman indicates, if huffman-flag is or will be set (depends on marshall or unmarshall, by default this flag is set to false), NOTE: If flag is set,the checksum - flag will be set automatically.

ztt::dcs::FeePacket::FeePacket std::vector< char * > *  feeContainer,
int  numberofTags = 1
 

Dummy constructor to get the actual ID for the ConfigureFero channel.

ztt::dcs::FeePacket::~FeePacket  ) 
 

Destructor for a FeePacket object.


Member Function Documentation

std::map< int, char * > ztt::dcs::FeePacket::getAnswerSet  )  [inline]
 

getAnswerSet() returns the set of expected answer ids.

short ztt::dcs::FeePacket::getErrorCode  )  const [inline]
 

Gives back the error Code, if it is the result data from the FeeServer. For more details see FeeServer: fee_errors.h

Returns:
error code

int ztt::dcs::FeePacket::getFeePacketSize  )  const [inline]
 

Gives back the size of the command in bytes

Returns:
the commandsize in bytes

FlagBits ztt::dcs::FeePacket::getFlags  )  const [inline]
 

Gives back the byte, representing the set flags.

0x0000 -> no flag is set 0x0002 -> only checksum flag is set 0x0003 -> huffman and checksum flag are set

NOTE :The huffman flag cannot be set alone! All other flags indicate a specific command that has to be executed by the feeserver itself. For details:
See also:
feepacket_flags.h
Returns:
the flag bits (2 byte)

unsigned int ztt::dcs::FeePacket::getId  )  const [inline]
 

Gives back package ID of this command

Returns:
package ID

char * ztt::dcs::FeePacket::getPayload  )  const [inline]
 

Gives back the payload of this command, note that the payload is not NULL terminated.

Returns:
payload

int ztt::dcs::FeePacket::getPayloadSize  )  const [inline]
 

Gives back the payload size

Returns:
payload size in bytes

void ztt::dcs::FeePacket::increaseID  )  [inline]
 

increases the ID of the packet when the packet is reused for a broadcast

bool ztt::dcs::FeePacket::isChecksumSet  )  const [inline]
 

Tells, if the checksum-flag is indicated

Returns:
true, if checksum-flag is or will be set

bool ztt::dcs::FeePacket::isHuffmanSet  )  const [inline]
 

Tells, if the huffman-flag is indicated

Returns:
true, if huffman-flag is or will be set

bool ztt::dcs::FeePacket::isValid  )  const [inline]
 

Tells, if payload is valid (checksum has been correct).

Returns:
true, if checksum has been correct.

char* ztt::dcs::FeePacket::marshall  ) 
 

Marshalls the command, so it can be send as byte-stream (char-stream) down to the FeeServer. The management of this memory is in the duty of the caller !

Returns:
the marshalled command as charstream

FeePacket* ztt::dcs::FeePacket::unmarshall char *  marshalledFeePacket,
int  size
[static]
 

Constructs a FeePacket out of a received byte-stream (char-stream). The management of the memory of the returned object is in the duty of the caller.

Parameters:
marshalledFeePacket the byte-stream from which the command will be constructed
size the size of the byte-stream in bytes (this is incl. headersize).
Returns:
the newly constructed FeePacket from the byte-stream


Member Data Documentation

std::vector<char*> ztt::dcs::FeePacket::feeServerNames
 

this vector store the target names of a packet. That mean that one packet is distributed to more then one server. This technique is used to save resources.


The documentation for this class was generated from the following file:
Generated on Fri Mar 30 02:54:34 2007 for InterComLayer by doxygen 1.3.5