VR-Link API Documentation for DIS
 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 
130  virtual void requestAttributeOwnershipAssumption (
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:
140  DtOwnershipAction myAcquisitionAction;
141  DtOwnershipAction myDivestAction;
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 

Document ID: Generated on Fri Dec 2 02:42:08 EST 2016 from SVN revision 171416
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)