#include <InteractionBroadcastList.hh>
Public Member Functions | |
InteractionBroadcastList (NetworkMessage *theMsg) | |
~InteractionBroadcastList () | |
Free all structures, including Message. | |
void | clear () |
Empty the list so it can reused(like the destructor). | |
void | addFederate (FederateHandle theFederate) |
void | sendPendingMessage (SecurityServer *Server) |
Public Attributes | |
NetworkMessage * | message |
The Message to be broadcasted. | |
Private Member Functions | |
InteractionBroadcastLine * | getLineWithFederate (FederateHandle theFederate) |
Return the line of the list describing federate 'federate', or 0. | |
Private Attributes | |
MessageBuffer | NM_msgBufSend |
std::list < InteractionBroadcastLine * > | lines |
Definition at line 48 of file InteractionBroadcastList.hh.
InteractionBroadcastList | ( | NetworkMessage * | theMsg | ) |
theMsg must have been allocated, and will be destroyed by the destructor. theMsg->NumeroFedere is added to the list, and its state is set as "Sent".
Definition at line 64 of file InteractionBroadcastList.cc.
References NetworkMessage::federate, certi::G, InteractionBroadcastList::lines, InteractionBroadcastList::message, PrettyDebug::Out(), pdGendoc, and InteractionBroadcastLine::sent.
Free all structures, including Message.
Definition at line 89 of file InteractionBroadcastList.cc.
References InteractionBroadcastList::clear().
void clear | ( | ) |
Empty the list so it can reused(like the destructor).
Definition at line 97 of file InteractionBroadcastList.cc.
References certi::D, InteractionBroadcastList::lines, InteractionBroadcastList::message, PrettyDebug::Out(), and pdTerm.
Referenced by InteractionBroadcastList::~InteractionBroadcastList().
void addFederate | ( | FederateHandle | federate | ) |
Add a federate to the list. If it was not present in the list, a new line is added and its state is set as bsNotSub. Then if the Federate has not been sent a message for this interaction, the line's state is set to bsWaiting.
Definition at line 44 of file InteractionBroadcastList.cc.
References certi::D, InteractionBroadcastList::getLineWithFederate(), InteractionBroadcastList::lines, PrettyDebug::Out(), pdRegister, pdTrace, and InteractionBroadcastLine::waiting.
Referenced by Subscribable::addFederatesIfOverlap().
void sendPendingMessage | ( | SecurityServer * | server | ) |
IMPORTANT: Before calling this method, be sure to set the Message->NumeroFederation handle.
Broadcast the message to all the Federate in the bsWaiting state, and then set their state to bsSent.
Definition at line 132 of file InteractionBroadcastList.cc.
References certi::BEST_EFFORT, certi::D, certi::G, SecurityServer::getSocketLink(), InteractionBroadcastList::lines, InteractionBroadcastList::message, InteractionBroadcastList::NM_msgBufSend, PrettyDebug::Out(), pdExcept, pdGendoc, pdProtocol, NetworkMessage::send(), InteractionBroadcastLine::sent, and InteractionBroadcastLine::waiting.
Referenced by Interaction::broadcastInteractionMessage().
InteractionBroadcastLine * getLineWithFederate | ( | FederateHandle | theFederate | ) | [private] |
Return the line of the list describing federate 'federate', or 0.
Definition at line 113 of file InteractionBroadcastList.cc.
References InteractionBroadcastList::lines.
Referenced by InteractionBroadcastList::addFederate().
The Message to be broadcasted.
This message must be allocated before calling the constructor of the class, be is deleted by the destructor.
Definition at line 62 of file InteractionBroadcastList.hh.
Referenced by Interaction::broadcastInteractionMessage(), InteractionBroadcastList::clear(), InteractionBroadcastList::InteractionBroadcastList(), and InteractionBroadcastList::sendPendingMessage().
MessageBuffer NM_msgBufSend [private] |
Definition at line 67 of file InteractionBroadcastList.hh.
Referenced by InteractionBroadcastList::sendPendingMessage().
std::list<InteractionBroadcastLine *> lines [private] |
Definition at line 68 of file InteractionBroadcastList.hh.
Referenced by InteractionBroadcastList::addFederate(), InteractionBroadcastList::clear(), InteractionBroadcastList::getLineWithFederate(), InteractionBroadcastList::InteractionBroadcastList(), and InteractionBroadcastList::sendPendingMessage().