VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
defaultOwnershipHandlerDIS.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2016 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
5 
6 #pragma once
7 
8 #if DtDIS
9 
10 #include <vl/ownershipHandler.h>
11 #include <vlpi/entityIdentifier.h>
12 #include <vl/entityPublisher.h>
13 
14 #include <list>
15 
17 {
21 };
22 
23 typedef void(*DtAcquireOwnershipCb)(const DtEntityIdentifier* disIdentifier, void* usr);
24 typedef void (*DtDivestOwnershipCb)(const DtEntityIdentifier* disIdentifier, void* usr);
25 
26 typedef bool (*DtAcquireOwnershipRequestCb)(const DtEntityIdentifier* disIdentifier, void* usr);
27 typedef bool (*DtDivestOwnershipRequestCb)(const DtEntityIdentifier* disIdentifier, void* usr);
28 
30 {
32  void* userData;
33 };
34 
36 {
38  void* userData;
39 };
40 
42 {
44  void* userData;
45 };
46 
48 {
50  void* userData;
51 };
52 
59 {
60 public:
63 
65  virtual ~DtDefaultOwnershipHandler();
66 
68  virtual DtOwnershipHandler* clone() const;
69 
72 
75 
79  virtual void setOwnershipAcquisitionAction(DtOwnershipAction);
80 
84  virtual void setOwnershipDivestitudeAction(DtOwnershipAction);
85 
88  virtual void gainOwnership();
89 
91  virtual void loseOwnership();
92 
97  //{@
98  virtual void addAcquireOwnershipCallback(DtAcquireOwnershipCb cb, void* usr);
99  virtual void removeAcquireOwnershipCallback(DtAcquireOwnershipCb cb, void* usr);
101 
104  //{@
105  virtual void addDivestOwnershipCallback(DtDivestOwnershipCb cb, void* usr);
106  virtual void removeDivestOwnershipCallback(DtDivestOwnershipCb cb, void* usr);
108 
112  //{@
113  virtual void addAcquireOwnershipRequestCallback(DtAcquireOwnershipRequestCb cb, void* usr);
114  virtual void removeAcquireOwnershipRequestCallback(DtAcquireOwnershipRequestCb cb, void* usr);
115 
116  virtual void addDivestOwnershipRequestCallback(DtDivestOwnershipRequestCb cb, void* usr);
117  virtual void removeDivestOwnershipRequestCallback(DtDivestOwnershipRequestCb cb, void* usr);
118 
119  virtual bool requestOwnershipRelease();
120  virtual bool requestOwnershipAssumption();
121 
122 protected:
125 
126  std::list<DtAcquireOwnershipCbInfo> myDefaultAcquireOwnershipCb;
127  std::list<DtDivestOwnershipCbInfo> myDefaultDivestOwnershipCb;
128  std::list<DtAcquireOwnershipRequestCbInfo> myAcquireOwnershipRequestCbList;
129  std::list<DtDivestOwnershipRequestCbInfo> myDivestOwnershipRequestCbList;
130 };
131 
132 
133 #endif //DtDIS
134 
Contains the DtEntityIdentifier class declaration.
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
DtOwnershipAction myAcquisitionAction
Definition: defaultOwnershipHandlerDIS.h:123
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
std::list< DtAcquireOwnershipRequestCbInfo > myAcquireOwnershipRequestCbList
Definition: defaultOwnershipHandlerDIS.h:128
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
std::list< DtDivestOwnershipCbInfo > myDefaultDivestOwnershipCb
Definition: defaultOwnershipHandlerDIS.h:127
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
DtOwnershipAction myDivestAction
Definition: defaultOwnershipHandlerDIS.h:124
std::list< DtDivestOwnershipRequestCbInfo > myDivestOwnershipRequestCbList
Definition: defaultOwnershipHandlerDIS.h:129
virtual bool requestOwnershipRelease()
Definition: defaultOwnershipHandlerDIS.h:47
This is a base class meant to encapsulate user callbacks on ownership management services.
Definition: ownershipHandlerDIS.h:39
std::list< DtAcquireOwnershipCbInfo > myDefaultAcquireOwnershipCb
Definition: defaultOwnershipHandlerDIS.h:126
virtual bool requestOwnershipAssumption()
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
This file provides protocol independence for DtEntityPublisher.
DtOwnershipAction
Definition: defaultOwnershipHandlerDIS.h:16
void(* DtDivestOwnershipCb)(const DtEntityIdentifier *disIdentifier, void *usr)
Definition: defaultOwnershipHandlerDIS.h:24

Document ID: Generated on Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)