ObjectClassBroadcastList Class Reference

#include <ObjectClassBroadcastList.hh>

List of all members.

Public Member Functions

 ObjectClassBroadcastList (NetworkMessage *, AttributeHandle=0)
 ~ObjectClassBroadcastList ()
 Free all structures, including Message.
void clear ()
 Empty the list so it can reused (like the destructor).
void addFederate (FederateHandle, AttributeHandle=0)
void sendPendingMessage (SecurityServer *server)

Public Attributes

NetworkMessagemessage

Private Member Functions

NetworkMessageadaptMessage (ObjectBroadcastLine *line)
ObjectBroadcastLinegetLineWithFederate (FederateHandle theFederate)
 Return the line of the list describing federate 'theFederate', or NULL.
bool isWaiting (ObjectBroadcastLine *line)
 Check if some attributes in the provided line have the "waiting" status.
void sendPendingDOMessage (SecurityServer *server)
void sendPendingRAVMessage (SecurityServer *server)

Private Attributes

AttributeHandle maxHandle
std::list< ObjectBroadcastLine * > lines
MessageBuffer NM_msgBufSend


Detailed Description

This class is used to carry necessary information for broadcasting a RegisterObject() or an UpdateAttributeValues().

Definition at line 53 of file ObjectClassBroadcastList.hh.


Constructor & Destructor Documentation

ObjectClassBroadcastList ( NetworkMessage theMsg,
AttributeHandle  maxAttHandle = 0 
)

theMsg must have been allocated, and will be destroyed by the destructor. theMsg->federate is added to the list, and its state is set as "Sent" for all attributes. For RAVs messages, MaxAttHandle is the greatest attribute handle of the class. For Discover_Object message, it can be 0 to mean "any attribute".

Definition at line 162 of file ObjectClassBroadcastList.cc.

References NetworkMessage::federate, ObjectClassBroadcastList::lines, ObjectClassBroadcastList::message, and ObjectBroadcastLine::sent.

Free all structures, including Message.

Definition at line 183 of file ObjectClassBroadcastList.cc.

References ObjectClassBroadcastList::clear().

Here is the call graph for this function:


Member Function Documentation

void clear (  ) 

Empty the list so it can reused (like the destructor).

Definition at line 191 of file ObjectClassBroadcastList.cc.

References certi::D, ObjectClassBroadcastList::lines, ObjectClassBroadcastList::maxHandle, ObjectClassBroadcastList::message, PrettyDebug::Out(), and pdTerm.

Referenced by ObjectClassBroadcastList::~ObjectClassBroadcastList().

Here is the call graph for this function:

void addFederate ( FederateHandle  theFederate,
AttributeHandle  theAttribute = 0 
)

Add a federate to the list. If it was not present in the list, a new line is added and all attributes are marked as bsNotSubscriber. Then if the Federate has not been sent a message for this attribute, the attribute (for the federate) is marked has ObjectBroadcastLine::waiting. theAttribute can be not specified in the case of a DiscoverObject message.

Definition at line 125 of file ObjectClassBroadcastList.cc.

References certi::D, ObjectClassBroadcastList::getLineWithFederate(), ObjectClassBroadcastList::lines, ObjectClassBroadcastList::maxHandle, ObjectBroadcastLine::notSub, PrettyDebug::Out(), pdExcept, pdRegister, pdTrace, ObjectBroadcastLine::sent, ObjectBroadcastLine::state, and ObjectBroadcastLine::waiting.

Referenced by Subscribable::addFederatesIfOverlap(), ObjectClass::broadcastClassMessage(), and ObjectClassAttribute::updateBroadcastList().

Here is the call graph for this function:

void sendPendingMessage ( SecurityServer server  ) 

IMPORTANT: Before calling this method, be sure to set the Message->federation handle.

Broadcast the message to all the Federate in the ObjectBroadcastLine::waiting state. If it is a DiscoverObject message, the message is sent as is, and the Federate is marked as ObjectBroadcastLine::sent for the ANY attribute. If it is a RAV message, the message is first copied, without the Attribute list, and then all pending attributes(in the bsWainting state) are added to the copy. The copy is sent, and attributes are marked as ObjectBroadcastLine::sent.

Definition at line 291 of file ObjectClassBroadcastList.cc.

References NetworkMessage::DISCOVER_OBJECT, certi::G, NetworkMessage::getType(), ObjectClassBroadcastList::message, PrettyDebug::Out(), pdGendoc, NetworkMessage::REFLECT_ATTRIBUTE_VALUES, NetworkMessage::REMOVE_OBJECT, NetworkMessage::REQUEST_ATTRIBUTE_OWNERSHIP_ASSUMPTION, ObjectClassBroadcastList::sendPendingDOMessage(), and ObjectClassBroadcastList::sendPendingRAVMessage().

Referenced by ObjectClass::broadcastClassMessage().

Here is the call graph for this function:

NetworkMessage * adaptMessage ( ObjectBroadcastLine line  )  [private]

ObjectBroadcastLine * getLineWithFederate ( FederateHandle  theFederate  )  [private]

Return the line of the list describing federate 'theFederate', or NULL.

Definition at line 209 of file ObjectClassBroadcastList.cc.

References ObjectClassBroadcastList::lines.

Referenced by ObjectClassBroadcastList::addFederate().

bool isWaiting ( ObjectBroadcastLine line  )  [private]

Check if some attributes in the provided line have the "waiting" status.

Definition at line 225 of file ObjectClassBroadcastList.cc.

References ObjectClassBroadcastList::maxHandle, ObjectBroadcastLine::state, and ObjectBroadcastLine::waiting.

Referenced by ObjectClassBroadcastList::sendPendingRAVMessage().

void sendPendingDOMessage ( SecurityServer server  )  [private]

The two next methods are called by the public SendPendingMessage methods. They respectively handle DiscoverObject and ReflectAttributeValues messages.

Definition at line 242 of file ObjectClassBroadcastList.cc.

References certi::D, SecurityServer::getSocketLink(), ObjectClassBroadcastList::lines, ObjectClassBroadcastList::message, ObjectClassBroadcastList::NM_msgBufSend, PrettyDebug::Out(), pdExcept, pdProtocol, NetworkMessage::send(), ObjectBroadcastLine::sent, and ObjectBroadcastLine::waiting.

Referenced by ObjectClassBroadcastList::sendPendingMessage().

Here is the call graph for this function:

void sendPendingRAVMessage ( SecurityServer server  )  [private]


Member Data Documentation

std::list<ObjectBroadcastLine *> lines [private]


The documentation for this class was generated from the following files:

Generated on Thu Apr 30 15:58:09 2009 for CERTIDeveloperDocumentation by doxygen 1.5.5