VR-Link API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
defaultOwnershipHandler.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 setAcquireOwnershipCallback(DtAcquireOwnershipCb cb, void* usr,
100  const DtObjClassDesc* desc = 0);
102 
105  //{@
106  virtual void setDivestOwnershipCallback(DtDivestOwnershipCb cb, void* usr,
107  const DtObjClassDesc* desc = 0);
109 
110  //Callback for acquiring and divesting requests. Are only called if you have OWNERSHIP_CALLBACK defined
111  //{@
112  virtual void addAcquireOwnershipRequestCallback(DtAcquireOwnershipRequestCb cb, void* usr);
113  virtual void removeAcquireOwnershipRequestCallback(DtAcquireOwnershipRequestCb cb, void* usr);
114 
115  virtual void addDivestOwnershipRequestCallback(DtDivestOwnershipRequestCb cb, void* usr);
116  virtual void removeDivestOwnershipRequestCallback(DtDivestOwnershipRequestCb cb, void* usr);
118 
119  virtual bool requestAttributeOwnershipRelease (
120  const RTI::AttributeHandleSet& candidateAttributes,
121 #if DtHLA_1516
122  const RTI::VariableLengthData &theTag
123 #else
124  const char* theTag
125 #endif
126  );
127 
129  const RTI::AttributeHandleSet& offeredAttributes,
130 #if DtHLA_1516
131  const RTI::VariableLengthData &theTag
132 #else
133  const char* theTag
134 #endif
135  );
136 
137 protected:
140 
141  std::map<RTI::ObjectClassHandle, DtAcquireOwnershipCbInfo> myAcquireOwnershipCbList;
142  std::map<RTI::ObjectClassHandle, DtDivestOwnershipCbInfo> myDivestOwnershipCbList;
145  std::list<DtAcquireOwnershipRequestCbInfo> myAcquireOwnershipRequestCbList;
146  std::list<DtDivestOwnershipRequestCbInfo> myDivestOwnershipRequestCbList;
147 };
148 
149 
150 #endif //DtHLA
151 

Document ID: Generated on Fri May 15 06:36:13 EDT 2015 from SVN revision 153263
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)