VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
defaultOwnershipHandlerHLA.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2014 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
5 
6 #pragma once
7 
8 #if DtHLA
9 
10 #include <vl/ownershipHandler.h>
11 #include <vl/objClassDesc.h>
12 
13 #include <list>
14 
16 {
20 };
21 
22 typedef void (*DtAcquireOwnershipCb)(DtHlaObject* hlaObject, void* usr);
23 typedef void (*DtDivestOwnershipCb)(DtHlaObject* hlaObject, void* usr);
24 
25 typedef bool (*DtAcquireOwnershipRequestCb)(DtHlaObject* hlaObject, void* usr);
26 typedef bool (*DtDivestOwnershipRequestCb)(DtHlaObject* hlaObject, void* usr);
27 
29 {
31  void* userData;
32 };
33 
35 {
37  void* userData;
38 };
39 
41 {
43  void* userData;
44 };
45 
47 {
49  void* userData;
50 };
51 
58 {
59 public:
62 
64  virtual ~DtDefaultOwnershipHandler();
65 
67  virtual DtOwnershipHandler* clone() const;
68 
71 
74 
78  virtual void setOwnershipAcquisitionAction(DtOwnershipAction);
79 
83  virtual void setOwnershipDivestitudeAction(DtOwnershipAction);
84 
88  virtual void gainOwnership(const RTI::AttributeHandleSet& set);
89 
94  virtual void loseOwnership(const RTI::AttributeHandleSet& set);
95 
98  //{@
99  virtual void addAcquireOwnershipCallback(DtAcquireOwnershipCb cb, void* usr, const DtObjClassDesc* desc = 0);
100  virtual void removeAcquireOwnershipCallback(DtAcquireOwnershipCb cb, void* usr, const DtObjClassDesc* desc = 0);
102 
105  //{@
106  virtual void addDivestOwnershipCallback(DtDivestOwnershipCb cb, void* usr, const DtObjClassDesc* desc = 0);
107  virtual void removeDivestOwnershipCallback(DtDivestOwnershipCb cb, void* usr, const DtObjClassDesc* desc = 0);
109 
113  //{@
114  virtual void addAcquireOwnershipRequestCallback(DtAcquireOwnershipRequestCb cb, void* usr);
115  virtual void removeAcquireOwnershipRequestCallback(DtAcquireOwnershipRequestCb cb, void* usr);
116 
117  virtual void addDivestOwnershipRequestCallback(DtDivestOwnershipRequestCb cb, void* usr);
118  virtual void removeDivestOwnershipRequestCallback(DtDivestOwnershipRequestCb cb, void* usr);
120 
121  virtual bool requesteOwnershipRelease (
122  const RTI::AttributeHandleSet& candidateAttributes,
123 #if DtHLA_1516
124  const RTI::VariableLengthData &theTag
125 #else
126  const char* theTag
127 #endif
128  );
129 
131  const RTI::AttributeHandleSet& offeredAttributes,
132 #if DtHLA_1516
133  const RTI::VariableLengthData &theTag
134 #else
135  const char* theTag
136 #endif
137  );
138 
139 protected:
142 
143  std::map<RTI::ObjectClassHandle, std::list<DtAcquireOwnershipCbInfo> > myAcquireOwnershipCbList;
144  std::map<RTI::ObjectClassHandle, std::list<DtDivestOwnershipCbInfo> > myDivestOwnershipCbList;
145  std::list<DtAcquireOwnershipCbInfo> myDefaultAcquireOwnershipCb;
146  std::list<DtDivestOwnershipCbInfo> myDefaultDivestOwnershipCb;
147  std::list<DtAcquireOwnershipRequestCbInfo> myAcquireOwnershipRequestCbList;
148  std::list<DtDivestOwnershipRequestCbInfo> myDivestOwnershipRequestCbList;
149 };
150 
151 
152 #endif //DtHLA
153 
virtual void loseOwnership(const RTI::AttributeHandleSet &set)
Called whenever the local federate has lost ownership of a set of attributes.
void * userData
Definition: defaultOwnershipHandlerHLA.h:43
void * userData
Definition: defaultOwnershipHandlerHLA.h:31
Definition: defaultOwnershipHandlerHLA.h:28
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
DtOwnershipAction myAcquisitionAction
Definition: defaultOwnershipHandlerHLA.h:140
DtOwnershipHandler & operator=(const DtOwnershipHandler &other)
Assignment operator.
void(* DtDivestOwnershipCb)(DtHlaObject *hlaObject, void *usr)
Definition: defaultOwnershipHandlerHLA.h:23
void * userData
Definition: defaultOwnershipHandlerHLA.h:49
Definition: defaultOwnershipHandlerHLA.h:40
virtual void gainOwnership(const RTI::AttributeHandleSet &set)
Called whenever the local federate has gained ownership of a set of attributes.
DtAcquireOwnershipCb cbFunction
Definition: defaultOwnershipHandlerHLA.h:30
void * userData
Definition: defaultOwnershipHandlerHLA.h:37
virtual void requestAttributeOwnershipAssumption(const RTI::AttributeHandleSet &offeredAttributes, const char *theTag)
Called as a result of the requestAttributeOwnershipAssumption RTI service.
virtual DtOwnershipHandler * clone() const
Clone copy.
bool(* DtAcquireOwnershipRequestCb)(DtHlaObject *hlaObject, void *usr)
Definition: defaultOwnershipHandlerHLA.h:25
DtDivestOwnershipCb cbFunction
Definition: defaultOwnershipHandlerHLA.h:36
An instance of DtObjClassDesc is a &quot;class descriptor&quot; for an HLA Object class.
Definition: objClassDesc13.h:41
std::map< RTI::ObjectClassHandle, std::list< DtDivestOwnershipCbInfo > > myDivestOwnershipCbList
Definition: defaultOwnershipHandlerHLA.h:144
DtOwnershipAction
Definition: defaultOwnershipHandlerHLA.h:15
DtDivestOwnershipRequestCb cbFunction
Definition: defaultOwnershipHandlerHLA.h:48
Definition: defaultOwnershipHandlerHLA.h:19
Instances of DtHlaObject are used to represent HLA objects which are communicated across the network...
Definition: hlaObject.h:56
std::list< DtAcquireOwnershipRequestCbInfo > myAcquireOwnershipRequestCbList
Definition: defaultOwnershipHandlerHLA.h:147
std::map< RTI::ObjectClassHandle, std::list< DtAcquireOwnershipCbInfo > > myAcquireOwnershipCbList
Definition: defaultOwnershipHandlerHLA.h:143
Definition: defaultOwnershipHandlerHLA.h:34
std::list< DtDivestOwnershipCbInfo > myDefaultDivestOwnershipCb
Definition: defaultOwnershipHandlerHLA.h:146
DtOwnershipAction myDivestAction
Definition: defaultOwnershipHandlerHLA.h:141
void(* DtAcquireOwnershipCb)(DtHlaObject *hlaObject, void *usr)
Definition: defaultOwnershipHandlerHLA.h:22
std::list< DtDivestOwnershipRequestCbInfo > myDivestOwnershipRequestCbList
Definition: defaultOwnershipHandlerHLA.h:148
Definition: defaultOwnershipHandlerHLA.h:46
Definition: defaultOwnershipHandlerHLA.h:17
This is a base class meant to encapsulate user callbacks on ownership management services.
Definition: ownershipHandlerHLA.h:27
virtual bool requesteOwnershipRelease(const RTI::AttributeHandleSet &candidateAttributes, const char *theTag)
Called as a result of the requestAttributeOwnershipRelease RTI service.
std::list< DtAcquireOwnershipCbInfo > myDefaultAcquireOwnershipCb
Definition: defaultOwnershipHandlerHLA.h:145
bool(* DtDivestOwnershipRequestCb)(DtHlaObject *hlaObject, void *usr)
Definition: defaultOwnershipHandlerHLA.h:26
This file declares DtOwnershipHandler.
This class meant to encapsulate user callbacks on ownership management services.
Definition: defaultOwnershipHandlerHLA.h:57
DtAcquireOwnershipRequestCb cbFunction
Definition: defaultOwnershipHandlerHLA.h:42
Definition: defaultOwnershipHandlerHLA.h:18

Document ID: Generated on Tue Feb 2 21:02:17 EST 2021 from SVN revision 223668
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)