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 MAK Technologies, Inc
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 
bool(* DtAcquireOwnershipRequestCb)(const DtEntityIdentifier *disIdentifier, void *usr)
Definition: defaultOwnershipHandlerDIS.h:26
void * userData
Definition: defaultOwnershipHandlerDIS.h:44
void * userData
Definition: defaultOwnershipHandlerDIS.h:32
Definition: defaultOwnershipHandlerDIS.h:29
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
DtOwnershipHandler & operator=(const DtOwnershipHandler &other)
Assignment operator.
void * userData
Definition: defaultOwnershipHandlerDIS.h:50
Definition: defaultOwnershipHandlerDIS.h:41
DtAcquireOwnershipCb cbFunction
Definition: defaultOwnershipHandlerDIS.h:31
void * userData
Definition: defaultOwnershipHandlerDIS.h:38
virtual DtOwnershipHandler * clone() const
Clone copy.
bool(* DtDivestOwnershipRequestCb)(const DtEntityIdentifier *disIdentifier, void *usr)
Definition: defaultOwnershipHandlerDIS.h:27
DtDivestOwnershipCb cbFunction
Definition: defaultOwnershipHandlerDIS.h:37
DtDivestOwnershipRequestCb cbFunction
Definition: defaultOwnershipHandlerDIS.h:49
Definition: defaultOwnershipHandlerDIS.h:35
Definition: defaultOwnershipHandlerDIS.h:18
Definition: defaultOwnershipHandlerDIS.h:19
virtual void loseOwnership()
Called whenever the local federate has lost ownership of an object.
void(* DtAcquireOwnershipCb)(const DtEntityIdentifier *disIdentifier, void *usr)
Definition: defaultOwnershipHandlerDIS.h:23
Definition: defaultOwnershipHandlerDIS.h:47
This is a base class meant to encapsulate user callbacks on ownership management services.
Definition: ownershipHandlerDIS.h:39
virtual void gainOwnership()
Called whenever the local federate has gained ownership of an object.
This file declares DtOwnershipHandler.
This class meant to encapsulate user callbacks on ownership management services.
Definition: defaultOwnershipHandlerDIS.h:58
DtAcquireOwnershipRequestCb cbFunction
Definition: defaultOwnershipHandlerDIS.h:43
Definition: defaultOwnershipHandlerDIS.h:20
DtOwnershipAction
Definition: defaultOwnershipHandlerDIS.h:16
void(* DtDivestOwnershipCb)(const DtEntityIdentifier *disIdentifier, void *usr)
Definition: defaultOwnershipHandlerDIS.h:24

Document ID: Generated on Wed Mar 27 02:04:30 EDT 2024 from SVN revision 264570
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)