Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

IDEA::MessageFactory Class Reference

#include <MessageFactory.hh>

List of all members.

Public Methods

 MessageFactory (const AgentRelay *agentRelay, const AgentTimingService *ats)
 Constructor.

virtual ~MessageFactory ()
 Destructor.

virtual MessageHandle createStopMessage (const PslToken *token) const
 Creates an StopMessage instance for token tokenId and returns a handle to the message.

virtual MessageHandle createStartMessage (const PslToken *token) const
 Create a StartMessage instance for token tokenId and returns a handle to the message.

virtual MessageHandle createValueMessage (const PslToken *token, int index) const
 Creates a ValueMessage instance for token tokenId and parameter at index and returns a handle to the message.

virtual MessageHandle createStatusMessage (const PslToken *token) const
 Creates a StatusMessage instance for token tokenId and returns a handle to the message.

virtual MessageHandle createTelemetryMessage (const std::string &to, const std::string &objectName, const std::string &attributeName, const std::string &value, int index) const
 Creates a TelemetryMessage instance to agent to for object objectName, attribute attributeName with value value for index index.


Private Types

typedef std::map< const PslToken *,
ObjectMessageData * > 
PslToken2ObjectMessageDataMap
typedef std::list< ObjectMessageData * > ObjectMessageDataList

Private Methods

virtual ObjectMessageDatacreateObjectData (const PslToken *token, const PslToken *topToken) const
 Creates an ObjectMessage instance for token tokenId and returns a handle to the message.

bool createObjectDataList (const PslToken *token, const PslToken *topToken, PslTokenSet &tokens, ObjectMessageDataList &objectMessageDataList) const
 Populates a list of object-messages. Each object-message corresponds to a dynamic parameter in the parameter-list of tokenId. A dynamic-paramater in itself corresponds to a token which in itself can have a parameter-list with dynamic-parameters. We recursively call this method for every dynamic-parameter with the same topTokenId. The topTokenId determines where we send the created object-messages (which we store in the object-message data).

void adjustTimesStartMessage (const PslToken *token, const Time &estSender, const Time &lstSender, const Time &eetSender, const Time &letSender, const Time &latencySender, Time &estReceiver, Time &lstReceiver, Time &eetReceiver, Time &letReceiver, const Time &latencyReceiver, bool openLoop) const
 Will manipulate the timing parameters of a start message we are sending to anouther agent.


Private Attributes

const AgentRelaym_AgentRelay
const AgentTimingServicem_AgentTimingService


Member Typedef Documentation

typedef std::list< ObjectMessageData* > IDEA::MessageFactory::ObjectMessageDataList [private]
 

typedef std::map< const PslToken*, ObjectMessageData* > IDEA::MessageFactory::PslToken2ObjectMessageDataMap [private]
 


Constructor & Destructor Documentation

IDEA::MessageFactory::MessageFactory const AgentRelay   agentRelay,
const AgentTimingService   ats
 

Constructor.

virtual IDEA::MessageFactory::~MessageFactory   [inline, virtual]
 

Destructor.


Member Function Documentation

void IDEA::MessageFactory::adjustTimesStartMessage const PslToken   token,
const Time   estSender,
const Time   lstSender,
const Time   eetSender,
const Time   letSender,
const Time   latencySender,
Time   estReceiver,
Time   lstReceiver,
Time   eetReceiver,
Time   letReceiver,
const Time   latencyReceiver,
bool    openLoop
const [private]
 

Will manipulate the timing parameters of a start message we are sending to anouther agent.

In case the latency of the receiving and sending agent are identical:

  • Earliest Start Time receiver is Earliest Start Time sender plus latency
  • Latest Start Time receiver is Latest Start Time sender plus two times the latency
If the token is open-loop:

  • Earliest End Time receiver is Earliest End Time sender plus latency
  • Latest End Time receiver is Latest End Time sender plus two times the latence
If the token is not-open-loop

  • Earliest End Time receiver is Earliest End Time sender minus latency
  • Latest End Time receiver is Latest End Time sender minus two times the latence
\Bug This must be a bug the way we adjust the EET and LET of the receiving token in case closed-loop

In case the latency if the receiving agent is larger than the latency of the sending agent:

  • Earliest Start Time receiver is Earliest Start Time sender plus receiver-latency
  • Latest Start Time receiver is Latest Start Time sender plus two times the receiver-latency
If the token is open loop

  • Earliest End Time receiver is Earliest End Time sender plus receiver-latency
  • Latest End Time receiver is Latest End Time sender plus two times the receiver-latence
If the token is not open loop

  • Earliest End Time receiver is Earliest End Time sender minus two times sender-latency plus receiver-latency
  • Latest End Time receiver is Latest End Time sender minus two times the sender-latence
In case the latency if the receiving agent is smaller than the latency of the sending agent:

  • Earliest Start Time receiver is Earliest Start Time sender minus sender-latency plus two times receiver-latency
  • Latest Start Time receiver is Latest Start Time sender plus two times the receiver-latency
If the token is open loop

  • Earliest End Time receiver is Earliest End Time sender minus sender-latency plus two times receiver-latency
  • Latest End Time receiver is Latest End Time sender plus two times the receiver-latence
If the token is not open loop

  • Earliest End Time receiver is Earliest End Time sender minus two times sender-latency plus receiver-latency
  • Latest End Time receiver is Latest End Time sender minus sender-latency minus receiver-latence

ObjectMessageData * IDEA::MessageFactory::createObjectData const PslToken   token,
const PslToken   topToken
const [private, virtual]
 

Creates an ObjectMessage instance for token tokenId and returns a handle to the message.

The parameter topToken indicates the token for which we make the objects (the objects are parameters of topToken)

bool IDEA::MessageFactory::createObjectDataList const PslToken   token,
const PslToken   topToken,
PslTokenSet   tokens,
ObjectMessageDataList   objectMessageDataList
const [private]
 

Populates a list of object-messages. Each object-message corresponds to a dynamic parameter in the parameter-list of tokenId. A dynamic-paramater in itself corresponds to a token which in itself can have a parameter-list with dynamic-parameters. We recursively call this method for every dynamic-parameter with the same topTokenId. The topTokenId determines where we send the created object-messages (which we store in the object-message data).

MessageHandle IDEA::MessageFactory::createStartMessage const PslToken   token const [virtual]
 

Create a StartMessage instance for token tokenId and returns a handle to the message.

enforce-singleton

MessageHandle IDEA::MessageFactory::createStatusMessage const PslToken   token const [virtual]
 

Creates a StatusMessage instance for token tokenId and returns a handle to the message.

MessageHandle IDEA::MessageFactory::createStopMessage const PslToken   token const [virtual]
 

Creates an StopMessage instance for token tokenId and returns a handle to the message.

MessageHandle IDEA::MessageFactory::createTelemetryMessage const std::string &    to,
const std::string &    objectName,
const std::string &    attributeName,
const std::string &    value,
int    index
const [virtual]
 

Creates a TelemetryMessage instance to agent to for object objectName, attribute attributeName with value value for index index.

A telemetry message is token independent. It will apply to the token which is on the timeline at receiving time.

MessageHandle IDEA::MessageFactory::createValueMessage const PslToken   token,
int    index
const [virtual]
 

Creates a ValueMessage instance for token tokenId and parameter at index and returns a handle to the message.


Member Data Documentation

const AgentRelay* IDEA::MessageFactory::m_AgentRelay [private]
 

const AgentTimingService* IDEA::MessageFactory::m_AgentTimingService [private]
 


Contact information
© IDEA
Generated on Fri Feb 3 17:09:46 2006 for IDEA.