MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Attributes
DtRequestDatabase Class Reference

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.

Detailed Description

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.

Member Typedef Documentation

Constructor & Destructor Documentation

DtRequestDatabase::DtRequestDatabase ( )
DtRequestDatabase::~DtRequestDatabase ( )
virtual

Member Function Documentation

void DtRequestDatabase::addPendingConfirm ( const DtAttributeHandleSet requestSet,
DtFederateHandle  fed 
)
virtual
void DtRequestDatabase::addRemoteRequest ( const DtAttributeHandleSet requestSet,
DtFederateHandle  fed 
)
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().

void DtRequestDatabase::addSkipPendingConfirm ( const DtAttributeHandleSet requestSet,
DtFederateHandle  fed 
)
virtual
void DtRequestDatabase::cancelAllRemoteRequest ( const DtAttributeHandleSet canceledSet)
virtual

Remove all supplied attributes from pending set and add them to canceled set.

References myRemoteCanceledRequestSet, removeRemoteRequest(), and DtAttributeHandleSet::setUnion().

Referenced by DtRtiObject::cancelAllRemoteRequests().

DtAttributeHandleSet DtRequestDatabase::canceledRequestSet ( ) const
virtual

Returns the set of canceled attributes requests.

References myRemoteCanceledRequestSet.

Referenced by DtRtiObject::canceledRequestSet(), and DtRtiObject::encode().

void DtRequestDatabase::cancelRemoteRequest ( const DtAttributeHandleSet canceledSet,
DtFederateHandle  fed 
)
virtual
void DtRequestDatabase::clearAll ( )
virtual
int DtRequestDatabase::confirmCount ( ) const
virtual

Return the number of pending confirmed attributes.

References myPendingConfirmSet, and DtAttributeHandleSet::size().

Referenced by DtRtiObject::confirmCount(), DtRtiObject::encode(), and DtRtiObject::encodedLength().

bool DtRequestDatabase::isRequestCanceled ( DtAttributeHandle  hand) const
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().

void DtRequestDatabase::markPendingRequestsUnavailable ( const DtAttributeHandleSet requestSet,
DtFederateHandle  confirmedFed 
)
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)
DtFederateHandle DtRequestDatabase::pendingConfirm ( DtAttributeHandle  hand) const
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().

DtAttributeHandleSet const & DtRequestDatabase::pendingConfirmAttributes ( ) const
virtual

Return the set of pending confirmed attributes.

References myPendingConfirmSet.

Referenced by DtRtiObject::pendingConfirmAttributes().

DtAttributeHandleSet DtRequestDatabase::pendingConfirmByFed ( DtFederateHandle  fed) const
virtual

Returns the current set of attributes that are pending confirm.

References DtAttributeHandleSet::add(), DtFederateHandleSet::isMember(), and myPendingConfirmByAttr.

Referenced by DtRtiObject::pendingConfirmByFed(), and requestedByFed().

DtFederateHandle DtRequestDatabase::pendingRemoteRequest ( DtAttributeHandle  hand) const
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().

DtFederateHandle DtRequestDatabase::pendingSkipConfirm ( DtAttributeHandle  hand) const
virtual
DtAttributeHandleSet const & DtRequestDatabase::pendingSkipConfirmAttributes ( ) const
virtual
DtAttributeHandleSet DtRequestDatabase::pendingSkipConfirmByFed ( DtFederateHandle  fed) const
virtual
DtFederateHandle DtRequestDatabase::releaseConfirm ( const DtAttributeHandleSet inSet,
DtAttributeHandleSet releasedSet 
)
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().

DtFederateHandle DtRequestDatabase::releaseRequested ( const DtAttributeHandleSet inSet,
DtAttributeHandleSet releasedSet,
bool  keepForConfirm 
)
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().

DtAttributeHandleSet DtRequestDatabase::remoteRequestByFed ( DtFederateHandle  fed) const
virtual

Returns the set of Attributes requested (not pending) by this federate.

References DtAttributeHandleSet::add(), DtFederateHandleSet::isMember(), and myRemoteRequestsByAttr.

Referenced by requestedByFed().

void DtRequestDatabase::removeCanceledRequests ( const DtAttributeHandleSet releaseSet)
virtual
void DtRequestDatabase::removePendingConfirm ( const DtAttributeHandleSet requestSet,
DtFederateHandle  fed 
)
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().

void DtRequestDatabase::removePendingConfirm ( const DtAttributeHandleSet requestSet)
virtual

Remote request of supplied attributes is complete.

Remove them from pending set.

References DtAttributeHandleSet::getHandle(), myPendingConfirmByAttr, myPendingConfirmSet, DtAttributeHandleSet::remove(), and DtAttributeHandleSet::size().

void DtRequestDatabase::removePendingSkipConfirm ( const DtAttributeHandleSet requestSet)
virtual
void DtRequestDatabase::removeRemoteRequest ( const DtAttributeHandleSet requestSet,
DtFederateHandle  fed 
)
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().

void DtRequestDatabase::removeRemoteRequest ( const DtAttributeHandleSet requestSet)
virtual

Remote request of supplied attributes is complete.

Remove them from pending set.

References DtAttributeHandleSet::getHandle(), myRemoteRequestsByAttr, myRemoteRequestSet, DtAttributeHandleSet::remove(), and DtAttributeHandleSet::size().

void DtRequestDatabase::removeSkipPendingConfirm ( const DtAttributeHandleSet requestSet,
DtFederateHandle  fed 
)
virtual
int DtRequestDatabase::requestCount ( ) const
virtual

Return the number of requested attributes.

References myRemoteRequestSet, and DtAttributeHandleSet::size().

Referenced by DtRtiObject::requestCount().

DtAttributeHandleSet const & DtRequestDatabase::requestedAttributes ( ) const
virtual

Return the set of requested attributes.

References myRemoteRequestSet.

Referenced by DtRtiObject::requestedAttributes().

DtAttributeHandleSet DtRequestDatabase::requestedByFed ( DtFederateHandle  fed,
bool  includePendingConfirm = false 
) const
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().

DtFederateHandle DtRequestDatabase::unavailablePendingRequests ( DtAttributeHandleSet invalidatedSet)
virtual

Get the next federate with pending requests that have become unavailable and the invalidated attrs.

References myUnavailableRequestsByFed.

Referenced by DtRtiObject::unavailablePendingRequests().

Member Data Documentation

DtAttrToFederatesMap DtRequestDatabase::myPendingConfirmByAttr
protected
DtAttributeHandleSet DtRequestDatabase::myPendingConfirmSet
protected
DtAttrToFederatesMap DtRequestDatabase::myPendingSkipConfirmByAttr
protected

In 1516-2010, the some pending confirms do not send unavailable.

Referenced by addSkipPendingConfirm(), clearAll(), pendingSkipConfirm(), pendingSkipConfirmByFed(), removePendingSkipConfirm(), and removeSkipPendingConfirm().

DtAttributeHandleSet DtRequestDatabase::myPendingSkipConfirmSet
protected
DtAttributeHandleSet DtRequestDatabase::myRemoteCanceledRequestSet
protected
DtAttrToFederatesMap DtRequestDatabase::myRemoteRequestsByAttr
protected
DtAttributeHandleSet DtRequestDatabase::myRemoteRequestSet
protected

Attributes whose ownership has been requested by a remote federate.

Referenced by addRemoteRequest(), clearAll(), moveRemoteRequestToPendingList(), releaseRequested(), removeRemoteRequest(), requestCount(), and requestedAttributes().

DtFedToAttributesMap DtRequestDatabase::myUnavailableRequestsByFed
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().


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

Document ID: Generated on Wed Mar 11 20:26:49 EDT 2015 from SVN revision 150939
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)