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

ztt::dcs::InterCom Class Reference

#include <InterCom.hpp>

List of all members.


Detailed Description

The InterCom is the main object for the InterComLayer. This represents the connection point for FedServer, FeeClient and DataAccess. It contains also the collections of the different FeeInfo objects for the comunication with the different FeeServers. It takes care of the initialisation, data retrieving, data exchanging and the command handling, and cleans up, when finished. The main logic is implemented here. To bee done: -> Maybe should be realized as singleton.

Author:
Christian Kofler, Sebastian Bablok
Date:
2003-05-27


Public Member Functions

 ~InterCom ()
void subscribe ()
void run (bool interactive=true)
void setUp ()
int sendCommand (char *target, boost::shared_ptr< FeePacket > pFeePacket)
int executeCommand (char *data, int size)
boost::shared_ptr< FeePacketcreateFeePacket (char *payload, int size, bool checksumFlag=false, FlagBits feeServerFlag=NO_FLAGS, bool huffmanFlag=false)
boost::shared_ptr< FeePacketcreateBroadCastFeePacket (char *payload, int size, bool checksumFlag=false, FlagBits feeServerFlag=NO_FLAGS, std::vector< char * > *feeserverCollection=NULL, bool huffmanFlag=false)
std::vector< FeeItemInfo * > * getFeeItemInfoCollection ()
std::vector< FeeAckInfo * > * getFeeAckInfoCollection ()
std::vector< FeeMsgInfo * > * getFeeMsgInfoCollection ()
void setLogEntry (unsigned int type, char *source, char *description)
bool validateServerName (const char *serverName)
FeeServerMapgetFeeServerMap ()
void setFeeServerMap (FeeServerMap)

Static Public Member Functions

void setConfigDir (const std::string &configDir)
InterComcreateInterCom ()


Constructor & Destructor Documentation

ztt::dcs::InterCom::~InterCom  ) 
 

Destructor for the InterCom


Member Function Documentation

boost::shared_ptr<FeePacket> ztt::dcs::InterCom::createFeePacket char *  payload,
int  size,
bool  checksumFlag = false,
FlagBits  feeServerFlag = NO_FLAGS,
bool  huffmanFlag = false
 

Function to create a FeePacket, wrapping command, for sending it to a FeeServer. If this command is destinated for the FeeServer itself (rather than for the CE), the feeServerFlag has to be declared here.

Parameters:
payload the payload, representing a command, that should be inserted in this FeePacket
size the size of the payload in bytes
checksumFlag indicates, if a checksum should be used. (default value of flag is false)
feeServerFlag contains flag bits, indicating commands to feeserver (default value of flag is NO_FLAGS)
huffmanFlag indicates, if huffmann coding should be used. (default value of flag is false)
Returns:
pointer to the created the command object

InterCom* ztt::dcs::InterCom::createInterCom  )  [static]
 

Method to create a single InterCom - object (Singleton). This method takes care, that only one InterCom - object is created at one time. If this object already exists, it returns the pointer to this object (see also "Design Patterns, GoF, - Singleton). This function must be static, because it is called without having an InterCom - object.

Returns:
pointer to the one and only InterCom - object.

int ztt::dcs::InterCom::executeCommand char *  data,
int  size
 

Receives commands for the InterCom-Layer itself, interprets these commands and executes them afterwards. The return value provides the success - message.

Parameters:
data the command - data, which the interCom must interpret.
size the size of the command - data.
Returns:
success message [0] or failure status [-60 ; -79] (for details see interCom defines).

std::vector< FeeAckInfo * > * ztt::dcs::InterCom::getFeeAckInfoCollection  )  [inline]
 

Getter for the FeeAckInfoCollection.

Returns:
pointer to the FeeAckInfoCollection

std::vector< FeeItemInfo * > * ztt::dcs::InterCom::getFeeItemInfoCollection  )  [inline]
 

Getter for the FeeItemInfoCollection.

Returns:
pointer to the FeeItemInfoCollection

std::vector< FeeMsgInfo * > * ztt::dcs::InterCom::getFeeMsgInfoCollection  )  [inline]
 

Getter for the FeeMsgInfoCollection.

Returns:
pointer to the FeeMsgInfoCollection

FeeServerMap * ztt::dcs::InterCom::getFeeServerMap  )  [inline]
 

Returns the adress of the current FeeMap object.

void ztt::dcs::InterCom::run bool  interactive = true  ) 
 

Function to run the interCom layer after SetUp.

int ztt::dcs::InterCom::sendCommand char *  target,
boost::shared_ptr< FeePacket pFeePacket
 

Function to send a command, wrapped in a FeePacket, to a FeeServer.

Parameters:
target the servername to which the command should be send
pFeePacket pointer to the command, that should be send
Returns:
the ID of the send command (ID of FeePacket) [1 - 65530]

void ztt::dcs::InterCom::setFeeServerMap FeeServerMap   )  [inline]
 

This function copy a initialized FeeServerMap to the local one.

Parameters:
FeeServerMap contain the initialized FeeServerMap

void ztt::dcs::InterCom::setLogEntry unsigned int  type,
char *  source,
char *  description
[inline]
 

Function to set a log entry. This function provides the logger with the needed infos for a log message and creates an entry. Used by the other parts of the InterCom - Layer to set log-entries.

Parameters:
type the loglevel type.
source where message original comes from.
description the message itself.

void ztt::dcs::InterCom::setUp  ) 
 

SetUp - includes function for the Mock Up version. Release setUp will be implemented, when database is defined.

void ztt::dcs::InterCom::subscribe  ) 
 

Function to subscribe to services.

bool ztt::dcs::InterCom::validateServerName const char *  serverName  ) 
 

Checks a given server name, if InterCom - Layer has been susbcribed to it (Compares the name with list of servers).

Parameters:
serverName the server name to check.
Returns:
true, if server is known to InterCom - Layer.


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