![]() |
MAK RTIspy API Documentation for HLA 1.3
|
class DtRequestDatabase More...
Collaboration diagram for DtRequestDatabase:Public Member Functions | |
| DtRequestDatabase () | |
| virtual | ~DtRequestDatabase () |
| virtual void | clearAll () |
| Clear database of all entries. | |
| virtual void | addRemoteRequest (const DtAttributeHandleSet &requestSet, DtFederateHandle fed) |
| Call to indicate that a remote federate has requested ownership of requestSet. | |
| virtual void | removeRemoteRequest (const DtAttributeHandleSet &requestSet, DtFederateHandle fed) |
| Remove a Federate from the list of federates pending confirm for a set of attributes. | |
| virtual void | removeRemoteRequest (const DtAttributeHandleSet &requestSet) |
| Remote request of supplied attributes is complete. | |
| virtual void | addPendingConfirm (const DtAttributeHandleSet &requestSet, DtFederateHandle fed) |
| Call to indicate that these this federate has matched a divest with a remote request. | |
| virtual void | removePendingConfirm (const DtAttributeHandleSet &requestSet, DtFederateHandle fed) |
| Remove a Federate from the list of federates pending confirm for a set of attributes. | |
| virtual void | addSkipPendingConfirm (const DtAttributeHandleSet &requestSet, DtFederateHandle fed) |
| virtual void | removeSkipPendingConfirm (const DtAttributeHandleSet &requestSet, DtFederateHandle fed) |
| virtual void | removePendingSkipConfirm (const DtAttributeHandleSet &requestSet) |
| virtual void | removePendingConfirm (const DtAttributeHandleSet &requestSet) |
| Remote request of supplied attributes is complete. | |
| void | moveRemoteRequestToPendingList (const DtAttributeHandleSet &requestSet) |
| Move all requests for the supplied attributes from the request list to the pending confirm list. | |
| virtual void | cancelRemoteRequest (const DtAttributeHandleSet &canceledSet, DtFederateHandle fed) |
| Remote request of supplied attributes is canceled. | |
| virtual void | cancelAllRemoteRequest (const DtAttributeHandleSet &canceledSet) |
| Remove all supplied attributes from pending set and add them to canceled set. | |
| virtual void | removeCanceledRequests (const DtAttributeHandleSet &releaseSet) |
| Remove the supplied attributes from the canceled set. | |
| virtual bool | isRequestCanceled (DtAttributeHandle hand) const |
| Returns boolean: is there a canceled request for the attribute for which the federate has not responded? | |
| virtual DtAttributeHandleSet | canceledRequestSet () const |
| Returns the set of canceled attributes requests. | |
| virtual DtFederateHandle | releaseRequested (const DtAttributeHandleSet &inSet, DtAttributeHandleSet *releasedSet, bool keepForConfirm) |
| Calls to this method with the attributes provided in inSet will remove and return in releaseSet any matching requested attributes from a single requesting federate, whose handle is the return argument. | |
| virtual DtFederateHandle | releaseConfirm (const DtAttributeHandleSet &inSet, DtAttributeHandleSet *releasedSet) |
| Calls to this method with the attributes provided in inSet will remove and return in releaseSet any matching pending confirm attributes assigned to a single requesting federate, whose handle is the return argument. | |
| virtual DtFederateHandle | pendingRemoteRequest (DtAttributeHandle hand) const |
| Returns the handle of the federate that has most recently requested ownership of this attribute. | |
| virtual DtFederateHandle | pendingConfirm (DtAttributeHandle hand) const |
| Returns the handle of the remote federate that will be given ownership pending confirmation from the local federate. | |
| virtual DtAttributeHandleSet | requestedByFed (DtFederateHandle fed, bool includePendingConfirm=false) const |
| Returns the set of attributes most recently requested by fed By default, attributes that are pending confirm are not returned. | |
| virtual DtAttributeHandleSet | remoteRequestByFed (DtFederateHandle fed) const |
| Returns the set of Attributes requested (not pending) by this federate. | |
| virtual DtAttributeHandleSet | pendingConfirmByFed (DtFederateHandle fed) const |
| Returns the current set of attributes that are pending confirm. | |
| virtual int | requestCount () const |
| Return the number of requested attributes. | |
| virtual DtAttributeHandleSet const & | requestedAttributes () const |
| Return the set of requested attributes. | |
| virtual int | confirmCount () const |
| Return the number of pending confirmed attributes. | |
| virtual DtAttributeHandleSet const & | pendingConfirmAttributes () const |
| Return the set of pending confirmed attributes. | |
| virtual DtAttributeHandleSet const & | pendingSkipConfirmAttributes () const |
| virtual void | markPendingRequestsUnavailable (const DtAttributeHandleSet &requestSet, DtFederateHandle confirmedFed) |
| Mark Pending Requests unavailable for all requesting federates except the federate which has been confirmed. | |
| virtual DtFederateHandle | unavailablePendingRequests (DtAttributeHandleSet *invalidatedSet) |
| Get the next federate with pending requests that have become unavailable and the invalidated attrs. | |
| virtual DtAttributeHandleSet | pendingSkipConfirmByFed (DtFederateHandle fed) const |
| virtual DtFederateHandle | pendingSkipConfirm (DtAttributeHandle hand) const |
Protected Types | |
| typedef std::map < DtAttributeHandle, DtFederateHandleSet > | DtAttrToFederatesMap |
| typedef std::map < DtFederateHandle, DtAttributeHandleSet > | DtFedToAttributesMap |
Protected Attributes | |
| DtAttributeHandleSet | myRemoteRequestSet |
| Attributes whose ownership has been requested by a remote federate. | |
| DtAttributeHandleSet | myRemoteCanceledRequestSet |
| Requests that have been canceled. Not important by whom. | |
| DtAttrToFederatesMap | myRemoteRequestsByAttr |
| DtAttrToFederatesMap | myPendingConfirmByAttr |
| In 1516, the attributes are not release until confirmed. | |
| DtAttributeHandleSet | myPendingConfirmSet |
| DtAttrToFederatesMap | myPendingSkipConfirmByAttr |
| In 1516-2010, the some pending confirms do not send unavailable. | |
| DtAttributeHandleSet | myPendingSkipConfirmSet |
| DtFedToAttributesMap | myUnavailableRequestsByFed |
| In 1516, multiple federates may have pending requests, when the divest is confirmed for one federate, the attrs become unavailable for all others. | |
class DtRequestDatabase
An object uses an instance of this class to manage ownership requests from remote federates. Adding a remote federate's request replaces any previous requests (i.e., only the most recent request is saved). As attributes are divested, this database is queried for matching requests. In the 1.3 IFSPEC, the requests are satisfied as soon as they are matched with a divestiture. In the 1516 IFSPEC, the request are not fully satisfied until the federate confirms the divestiture. A request can be canceled (and removed from the database). In the 1.3 IFSPEC, canceled requests are maintained in order to determine valid releases. Released attributes must have been requested, but a request can be canceled after a release request but before the release response.
|
protected |
|
protected |
| DtRequestDatabase::DtRequestDatabase | ( | ) |
|
virtual |
|
virtual |
Call to indicate that these this federate has matched a divest with a remote request.
References DtAttributeHandleSet::add(), DtAttributeHandleSet::getHandle(), myPendingConfirmByAttr, myPendingConfirmSet, myRemoteCanceledRequestSet, DtAttributeHandleSet::remove(), and DtAttributeHandleSet::size().
Referenced by DtRtiObject::addPendingConfirm().
|
virtual |
Call to indicate that a remote federate has requested ownership of requestSet.
If an attribute is passed to this function more than once, the more recent request takes precedence. That is, when it's time to divest, we will divest the attribute to the most recent requesting federate.
References DtAttributeHandleSet::add(), DtAttributeHandleSet::getHandle(), myRemoteCanceledRequestSet, myRemoteRequestsByAttr, myRemoteRequestSet, DtAttributeHandleSet::remove(), and DtAttributeHandleSet::size().
Referenced by DtRtiObject::addRemoteRequest().
|
virtual |
|
virtual |
Remove all supplied attributes from pending set and add them to canceled set.
References myRemoteCanceledRequestSet, removeRemoteRequest(), and DtAttributeHandleSet::setUnion().
Referenced by DtRtiObject::cancelAllRemoteRequests().
|
virtual |
Returns the set of canceled attributes requests.
References myRemoteCanceledRequestSet.
Referenced by DtRtiObject::canceledRequestSet(), and DtRtiObject::encode().
|
virtual |
Remote request of supplied attributes is canceled.
Remove them from pending set and add them to canceled set.
References DtAttributeHandleSet::add(), DtAttributeHandleSet::getHandle(), myPendingConfirmByAttr, myRemoteCanceledRequestSet, myRemoteRequestsByAttr, removePendingConfirm(), removeRemoteRequest(), DtAttributeHandleSet::setUnion(), and DtAttributeHandleSet::size().
Referenced by DtRtiObject::cancelRemoteRequest().
|
virtual |
Clear database of all entries.
References DtAttributeHandleSet::empty(), myPendingConfirmByAttr, myPendingConfirmSet, myPendingSkipConfirmByAttr, myPendingSkipConfirmSet, myRemoteCanceledRequestSet, myRemoteRequestsByAttr, myRemoteRequestSet, and myUnavailableRequestsByFed.
Referenced by DtRtiObject::decode().
|
virtual |
Return the number of pending confirmed attributes.
References myPendingConfirmSet, and DtAttributeHandleSet::size().
Referenced by DtRtiObject::confirmCount(), DtRtiObject::encode(), and DtRtiObject::encodedLength().
|
virtual |
Returns boolean: is there a canceled request for the attribute for which the federate has not responded?
References DtAttributeHandleSet::isMember(), and myRemoteCanceledRequestSet.
Referenced by DtRtiObject::isRequestCanceled().
|
virtual |
Mark Pending Requests unavailable for all requesting federates except the federate which has been confirmed.
References DtAttributeHandleSet::getHandle(), DtFederateHandleSet::getHandle(), myPendingConfirmByAttr, myRemoteRequestsByAttr, myUnavailableRequestsByFed, DtAttributeHandleSet::size(), and DtFederateHandleSet::size().
Referenced by releaseConfirm().
| void DtRequestDatabase::moveRemoteRequestToPendingList | ( | const DtAttributeHandleSet & | requestSet | ) |
Move all requests for the supplied attributes from the request list to the pending confirm list.
References DtAttributeHandleSet::add(), DtAttributeHandleSet::getHandle(), DtFederateHandleSet::getHandle(), myPendingConfirmByAttr, myPendingConfirmSet, myRemoteRequestsByAttr, myRemoteRequestSet, DtAttributeHandleSet::remove(), DtAttributeHandleSet::size(), and DtFederateHandleSet::size().
Referenced by releaseRequested().
|
virtual |
Returns the handle of the remote federate that will be given ownership pending confirmation from the local federate.
References DtFederateHandleSet::getHandle(), and myPendingConfirmByAttr.
Referenced by DtRtiObject::pendingConfirm(), and releaseConfirm().
|
virtual |
Return the set of pending confirmed attributes.
References myPendingConfirmSet.
Referenced by DtRtiObject::pendingConfirmAttributes().
|
virtual |
Returns the current set of attributes that are pending confirm.
References DtAttributeHandleSet::add(), DtFederateHandleSet::isMember(), and myPendingConfirmByAttr.
Referenced by DtRtiObject::pendingConfirmByFed(), and requestedByFed().
|
virtual |
Returns the handle of the federate that has most recently requested ownership of this attribute.
References DtFederateHandleSet::getHandle(), and myRemoteRequestsByAttr.
Referenced by DtRtiObject::pendingRemoteRequest(), and releaseRequested().
|
virtual |
References DtFederateHandleSet::getHandle(), and myPendingSkipConfirmByAttr.
Referenced by DtRtiObject::pendingSkipConfirm().
|
virtual |
References myPendingSkipConfirmSet.
Referenced by DtRtiObject::pendingSkipConfirmAttributes().
|
virtual |
References DtAttributeHandleSet::add(), DtFederateHandleSet::isMember(), and myPendingSkipConfirmByAttr.
Referenced by DtRtiObject::pendingSkipConfirmByFed().
|
virtual |
Calls to this method with the attributes provided in inSet will remove and return in releaseSet any matching pending confirm attributes assigned to a single requesting federate, whose handle is the return argument.
The method should be called repeatedly until it returns 0 to release all the matching attributes. Not all the attributes may match a pending confirm.
References DtAttributeHandleSet::add(), DtAttributeHandleSet::empty(), DtAttributeHandleSet::getHandle(), markPendingRequestsUnavailable(), myPendingConfirmSet, pendingConfirm(), removeCanceledRequests(), removePendingConfirm(), DtAttributeHandleSet::setIntersection(), and DtAttributeHandleSet::size().
Referenced by DtRtiObject::releaseConfirm().
|
virtual |
Calls to this method with the attributes provided in inSet will remove and return in releaseSet any matching requested attributes from a single requesting federate, whose handle is the return argument.
The method should be called repeatedly until it returns 0 to release all the matching attributes. In 1516 negotiated divest, these attributes are not fully released. Set the bool value to move them to a pending confirm status (see releaseConfirm below). Not all the attributes may match a request.
References DtAttributeHandleSet::add(), DtAttributeHandleSet::empty(), DtAttributeHandleSet::getHandle(), moveRemoteRequestToPendingList(), myRemoteRequestSet, pendingRemoteRequest(), removeCanceledRequests(), removeRemoteRequest(), DtAttributeHandleSet::setIntersection(), and DtAttributeHandleSet::size().
Referenced by DtRtiObject::releaseRequested().
|
virtual |
Returns the set of Attributes requested (not pending) by this federate.
References DtAttributeHandleSet::add(), DtFederateHandleSet::isMember(), and myRemoteRequestsByAttr.
Referenced by requestedByFed().
|
virtual |
Remove the supplied attributes from the canceled set.
References myRemoteCanceledRequestSet, and DtAttributeHandleSet::removeSetIntersection().
Referenced by DtRtiObject::releaseAttrs(), releaseConfirm(), releaseRequested(), and DtRtiObject::removeCanceledRequests().
|
virtual |
Remove a Federate from the list of federates pending confirm for a set of attributes.
Note: this method assumes that caller handles the case that this is the last pending Federate.
References DtAttributeHandleSet::getHandle(), myPendingConfirmByAttr, myPendingConfirmSet, DtAttributeHandleSet::remove(), DtFederateHandleSet::remove(), DtAttributeHandleSet::size(), and DtFederateHandleSet::size().
Referenced by cancelRemoteRequest(), releaseConfirm(), and DtRtiObject::removePendingConfirm().
|
virtual |
Remote request of supplied attributes is complete.
Remove them from pending set.
References DtAttributeHandleSet::getHandle(), myPendingConfirmByAttr, myPendingConfirmSet, DtAttributeHandleSet::remove(), and DtAttributeHandleSet::size().
|
virtual |
|
virtual |
Remove a Federate from the list of federates pending confirm for a set of attributes.
Note: this method assumes that caller handles the case that this is the last pending Federate.
References DtAttributeHandleSet::getHandle(), myPendingConfirmByAttr, myPendingConfirmSet, myRemoteRequestsByAttr, DtAttributeHandleSet::remove(), DtFederateHandleSet::remove(), DtAttributeHandleSet::size(), and DtFederateHandleSet::size().
Referenced by cancelAllRemoteRequest(), cancelRemoteRequest(), DtRtiObject::releaseAttrs(), releaseRequested(), and DtRtiObject::removeRemoteRequest().
|
virtual |
Remote request of supplied attributes is complete.
Remove them from pending set.
References DtAttributeHandleSet::getHandle(), myRemoteRequestsByAttr, myRemoteRequestSet, DtAttributeHandleSet::remove(), and DtAttributeHandleSet::size().
|
virtual |
|
virtual |
Return the number of requested attributes.
References myRemoteRequestSet, and DtAttributeHandleSet::size().
Referenced by DtRtiObject::requestCount().
|
virtual |
Return the set of requested attributes.
References myRemoteRequestSet.
Referenced by DtRtiObject::requestedAttributes().
|
virtual |
Returns the set of attributes most recently requested by fed By default, attributes that are pending confirm are not returned.
References pendingConfirmByFed(), remoteRequestByFed(), and DtAttributeHandleSet::setUnion().
Referenced by DtRtiObject::requestedByFed().
|
virtual |
Get the next federate with pending requests that have become unavailable and the invalidated attrs.
References myUnavailableRequestsByFed.
Referenced by DtRtiObject::unavailablePendingRequests().
|
protected |
In 1516, the attributes are not release until confirmed.
Referenced by addPendingConfirm(), cancelRemoteRequest(), clearAll(), markPendingRequestsUnavailable(), moveRemoteRequestToPendingList(), pendingConfirm(), pendingConfirmByFed(), removePendingConfirm(), and removeRemoteRequest().
|
protected |
|
protected |
In 1516-2010, the some pending confirms do not send unavailable.
Referenced by addSkipPendingConfirm(), clearAll(), pendingSkipConfirm(), pendingSkipConfirmByFed(), removePendingSkipConfirm(), and removeSkipPendingConfirm().
|
protected |
|
protected |
Requests that have been canceled. Not important by whom.
Referenced by addPendingConfirm(), addRemoteRequest(), addSkipPendingConfirm(), cancelAllRemoteRequest(), canceledRequestSet(), cancelRemoteRequest(), clearAll(), isRequestCanceled(), and removeCanceledRequests().
|
protected |
|
protected |
Attributes whose ownership has been requested by a remote federate.
Referenced by addRemoteRequest(), clearAll(), moveRemoteRequestToPendingList(), releaseRequested(), removeRemoteRequest(), requestCount(), and requestedAttributes().
|
protected |
In 1516, multiple federates may have pending requests, when the divest is confirmed for one federate, the attrs become unavailable for all others.
Referenced by clearAll(), markPendingRequestsUnavailable(), and unavailablePendingRequests().