VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
DtOwnershipHandler Class Reference

This is a base class meant to encapsulate user callbacks on ownership management services. More...

+ Inheritance diagram for DtOwnershipHandler:
+ Collaboration diagram for DtOwnershipHandler:

Public Member Functions

 DtOwnershipHandler ()
 Constructor. More...
 
virtual ~DtOwnershipHandler ()
 Destructor. More...
 
 DtOwnershipHandler (const DtOwnershipHandler &other)
 Copy constructor. More...
 
DtOwnershipHandleroperator= (const DtOwnershipHandler &other)
 Assignment operator. More...
 
virtual DtOwnershipHandlerclone () const
 Clone copy. More...
 
virtual void divestObject (DtU16 siteTarget, DtU16 applicationTarget)
 Begin a DIS 7 push request for this object The entire process will by default be automated from here. More...
 
virtual void acquireObject ()
 Begin a DIS 7 pull request for this object The entire process will by default be automated from here. More...
 
virtual void setExConn (DtExerciseConn *exConn)
 
virtual void setEntityId (const DtEntityIdentifier &entityId)
 
virtual void setAutoResponseTimer (double time)
 By default DIS 7 allows for 5 seconds for transfer ownership to happen before it gets cancelled. More...
 

Protected Member Functions

virtual void acknowledgeCallback (DtAcknowledgeRPdu *ack)
 
virtual void setRecordCallback (DtSetRecordPdu *setRec)
 
virtual void eventReportCallback (DtEventReportPdu *setRec)
 
virtual void transferOwnershipCallback (DtTransferControlRequestPdu *transfer)
 
virtual void transferFailed ()
 Sent whenever a transfer did not complete. More...
 
virtual void gainOwnership ()
 Called whenever the local federate has gained ownership of an object. More...
 
virtual void loseOwnership ()
 Called whenever the local federate has lost ownership of an object. More...
 
virtual bool requestOwnershipRelease ()
 
virtual bool requestOwnershipAssumption ()
 

Static Protected Member Functions

static void acknowledgeRCb (DtAcknowledgeRPdu *ack, void *usr)
 The following callbacks are used internally to handle the back and forth messaging required in a DIS ownership transfer. More...
 
static void setRecordCb (DtSetRecordPdu *setRec, void *usr)
 
static void eventReportCb (DtEventReportPdu *setRec, void *usr)
 
static void transferOwnershipCb (DtTransferControlRequestPdu *setRec, void *usr)
 

Protected Attributes

DtOwnershipStatus myStatus
 
DtTime myOwnershipTimer
 
double myAutoResponseTimer
 
DtU32 myRequestId
 
DtExerciseConnmyExConn
 
DtEntityIdentifier myEntityId
 
bool myAckReceived
 
bool myEventReportReceived
 

Detailed Description

This is a base class meant to encapsulate user callbacks on ownership management services.

Users should derive from this class, override the empty functions declared here with implementations that perform desired actions. The DtDefaultOwnershipHandler is a derivation of this class that provides easy ownership transfer in DIS.

Constructor & Destructor Documentation

DtOwnershipHandler::DtOwnershipHandler ( )

Constructor.

virtual DtOwnershipHandler::~DtOwnershipHandler ( )
virtual

Destructor.

DtOwnershipHandler::DtOwnershipHandler ( const DtOwnershipHandler other)

Copy constructor.

Member Function Documentation

virtual void DtOwnershipHandler::acknowledgeCallback ( DtAcknowledgeRPdu ack)
protectedvirtual
static void DtOwnershipHandler::acknowledgeRCb ( DtAcknowledgeRPdu ack,
void *  usr 
)
staticprotected

The following callbacks are used internally to handle the back and forth messaging required in a DIS ownership transfer.

virtual void DtOwnershipHandler::acquireObject ( )
virtual

Begin a DIS 7 pull request for this object The entire process will by default be automated from here.

virtual DtOwnershipHandler* DtOwnershipHandler::clone ( ) const
virtual

Clone copy.

Reimplemented in DtDefaultOwnershipHandler.

virtual void DtOwnershipHandler::divestObject ( DtU16  siteTarget,
DtU16  applicationTarget 
)
virtual

Begin a DIS 7 push request for this object The entire process will by default be automated from here.

Parameters
siteTargetthe destination site where you want the object to go
appicationTargetthe destination application where you want the object to go.
virtual void DtOwnershipHandler::eventReportCallback ( DtEventReportPdu setRec)
protectedvirtual
static void DtOwnershipHandler::eventReportCb ( DtEventReportPdu setRec,
void *  usr 
)
staticprotected
virtual void DtOwnershipHandler::gainOwnership ( )
protectedvirtual

Called whenever the local federate has gained ownership of an object.

Reimplemented in DtDefaultOwnershipHandler.

virtual void DtOwnershipHandler::loseOwnership ( )
protectedvirtual

Called whenever the local federate has lost ownership of an object.

Reimplemented in DtDefaultOwnershipHandler.

DtOwnershipHandler& DtOwnershipHandler::operator= ( const DtOwnershipHandler other)

Assignment operator.

virtual bool DtOwnershipHandler::requestOwnershipAssumption ( )
protectedvirtual

Reimplemented in DtDefaultOwnershipHandler.

virtual bool DtOwnershipHandler::requestOwnershipRelease ( )
protectedvirtual

Reimplemented in DtDefaultOwnershipHandler.

virtual void DtOwnershipHandler::setAutoResponseTimer ( double  time)
virtual

By default DIS 7 allows for 5 seconds for transfer ownership to happen before it gets cancelled.

You can change this value by calling this function.

virtual void DtOwnershipHandler::setEntityId ( const DtEntityIdentifier entityId)
virtual
virtual void DtOwnershipHandler::setExConn ( DtExerciseConn exConn)
virtual
virtual void DtOwnershipHandler::setRecordCallback ( DtSetRecordPdu setRec)
protectedvirtual
static void DtOwnershipHandler::setRecordCb ( DtSetRecordPdu setRec,
void *  usr 
)
staticprotected
virtual void DtOwnershipHandler::transferFailed ( )
protectedvirtual

Sent whenever a transfer did not complete.

virtual void DtOwnershipHandler::transferOwnershipCallback ( DtTransferControlRequestPdu transfer)
protectedvirtual
static void DtOwnershipHandler::transferOwnershipCb ( DtTransferControlRequestPdu setRec,
void *  usr 
)
staticprotected

Member Data Documentation

bool DtOwnershipHandler::myAckReceived
protected
double DtOwnershipHandler::myAutoResponseTimer
protected
DtEntityIdentifier DtOwnershipHandler::myEntityId
protected
bool DtOwnershipHandler::myEventReportReceived
protected
DtExerciseConn* DtOwnershipHandler::myExConn
protected
DtTime DtOwnershipHandler::myOwnershipTimer
protected
DtU32 DtOwnershipHandler::myRequestId
protected
DtOwnershipStatus DtOwnershipHandler::myStatus
protected

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

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)