# 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
NetworkMessage * | message
## Private Member Functions
NetworkMessage * | adaptMessage (ObjectBroadcastLine *line)
ObjectBroadcastLine * | getLineWithFederate (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.

~ObjectClassBroadcastList | ( |  | ) |

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]`

Return a copy of the REFLECT_ATTRIBUTE_VALUES message 'Message' containing references omly to the attributes marked as bsWaiting in the line 'line'. The returned message should be deleted later.

Definition at line 58 of file ObjectClassBroadcastList.cc.

References NM_Factory::create(), NetworkMessage::federate, NetworkMessage::federation, certi::G, NetworkMessage::getDate(), NetworkMessage::getLabel(), NetworkMessage::getTag(), NetworkMessage::getType(), NetworkMessage::handleArray, NetworkMessage::handleArraySize, NetworkMessage::isDated(), NetworkMessage::isLabelled(), NetworkMessage::isTagged(), ObjectClassBroadcastList::message, NetworkMessage::object, NetworkMessage::objectClass, PrettyDebug::Out(), pdGendoc, NetworkMessage::REFLECT_ATTRIBUTE_VALUES, NetworkMessage::REQUEST_ATTRIBUTE_OWNERSHIP_ASSUMPTION, NetworkMessage::setDate(), NetworkMessage::setLabel(), NetworkMessage::setTag(), NetworkMessage::sizeValueArray(), ObjectBroadcastLine::state, NetworkMessage::valueArray, and ObjectBroadcastLine::waiting.

Referenced by ObjectClassBroadcastList::sendPendingRAVMessage().

Here is the call graph for this function:

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]`

Definition at line 317 of file ObjectClassBroadcastList.cc.

References ObjectClassBroadcastList::adaptMessage(), certi::BEST_EFFORT, certi::D, certi::G, SecurityServer::getSocketLink(), NetworkMessage::handleArray, NetworkMessage::handleArraySize, ObjectClassBroadcastList::isWaiting(), ObjectClassBroadcastList::lines, ObjectClassBroadcastList::maxHandle, ObjectClassBroadcastList::message, ObjectClassBroadcastList::NM_msgBufSend, PrettyDebug::Out(), pdExcept, pdGendoc, pdProtocol, NetworkMessage::send(), ObjectBroadcastLine::sent, and ObjectBroadcastLine::waiting.

Referenced by ObjectClassBroadcastList::sendPendingMessage().

Here is the call graph for this function:

## Member Data Documentation

NetworkMessage* message

Definition at line 63 of file ObjectClassBroadcastList.hh.

Referenced by ObjectClassBroadcastList::adaptMessage(), ObjectClass::broadcastClassMessage(), ObjectClassBroadcastList::clear(), ObjectClassBroadcastList::ObjectClassBroadcastList(), ObjectClassBroadcastList::sendPendingDOMessage(), ObjectClassBroadcastList::sendPendingMessage(), ObjectClassBroadcastList::sendPendingRAVMessage(), and ObjectClassAttribute::updateBroadcastList().

AttributeHandle maxHandle`[private]`

Definition at line 80 of file ObjectClassBroadcastList.hh.

Referenced by ObjectClassBroadcastList::addFederate(), ObjectClassBroadcastList::clear(), ObjectClassBroadcastList::isWaiting(), and ObjectClassBroadcastList::sendPendingRAVMessage().

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

Definition at line 81 of file ObjectClassBroadcastList.hh.

Referenced by ObjectClassBroadcastList::addFederate(), ObjectClassBroadcastList::clear(), ObjectClassBroadcastList::getLineWithFederate(), ObjectClassBroadcastList::ObjectClassBroadcastList(), ObjectClassBroadcastList::sendPendingDOMessage(), and ObjectClassBroadcastList::sendPendingRAVMessage().

MessageBuffer NM_msgBufSend`[private]`

Definition at line 83 of file ObjectClassBroadcastList.hh.

Referenced by ObjectClassBroadcastList::sendPendingDOMessage(), and ObjectClassBroadcastList::sendPendingRAVMessage().

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

- ObjectClassBroadcastList.hh
- ObjectClassBroadcastList.cc