VR-Vantage 2.8 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
reflectedExtAggregate.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2017 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
14 
15 #if DtHLA
16 // In HLA we need to derive from DtReflectedObject instead of DtReflectedAggregate so that
17 // we can make use of the constructor that takes a state repository to use.
18 # include <vl/reflectedObjectHLA.h>
19 # define DtAggReflectedObjectType DtReflectedObject
20 #else // DtDIS
21 # include <vl/reflectedAggregateDIS.h>
22 # define DtAggReflectedObjectType DtReflectedAggregate
23 #endif
24 
25 // Callback function that takes a DtReflectedExtAggregate and usr data.
27 
29 (
30  DtReflectedExtAggregate* obj, void* userData
31 );
32 
33 class DtExerciseConn;
34 
36 {
37 
38 public:
39 
40 #if DtHLA
42  (
43  DtHlaObject* obj,
44  DtExerciseConn* conn
45  );
46  DtReflectedExtAggregate(DtExerciseConn* conn, DtAggregateStateRepository* esrToUse);
47 #else // DtDIS
48  // constructor
50  (
51  DtExerciseConn* conn,
52  const DtEntityIdentifier& id,
53  const DtEntityType& type
54  );
55 #endif
56 
57  // destructor
58  virtual ~DtReflectedExtAggregate();
59 
60  // Returns a pointer to an aggregate state repository through which you can
61  // inspect current state info.
62  virtual DtExtAggregateStateRepository* extAggregateStateRep() const;
63 
64  // Synonym for extAggregateStateRep.
65  virtual DtExtAggregateStateRepository* easr() const;
66 
67  // Implementation for abstract base class. Calls cosr().
68  virtual DtStateRepository* stateRep() const;
69 
70 #if DtDIS
71  // Process an aggregate state PDU.
72  // Calls DtReflectedAggregate::processStateMessage().
73  virtual void processStateMessage(const DtStateMsg& msg);
74 #endif
75 
76  // Get the next and previous elements in the reflected aggregate list.
77  virtual DtReflectedExtAggregate* nextEA() const;
78  virtual DtReflectedExtAggregate* prevEA() const;
79 
80  // Get the next and previous elements, wrap at the ends of the list.
81  virtual DtReflectedExtAggregate* wrapNextEA() const;
82  virtual DtReflectedExtAggregate* wrapPrevEA() const;
83 
84  // Aggregate callback registration/deregistration.
85  virtual void addPostUpdateCallback
86  (
87  DtExtAggregateCallbackFunction cb, void* userData
88  );
89  virtual void removePostUpdateCallback
90  (
91  DtExtAggregateCallbackFunction cb, void* userData
92  );
93 
94  static void postUpdateCallback
95  (
96  DtReflectedExtAggregate* agg, void* userData
97  );
98 
99  virtual void processPostUpdateCallback(DtReflectedExtAggregate* agg);
100 
101  virtual void updateExtensions();
102 
103  // Overridden from bast class to make public.
104  virtual void processPostUpdateCallbacks();
105 
106 private:
107 
108  // copy constructor
110 
111  // assignment operator
112  DtReflectedExtAggregate& operator=(const DtReflectedExtAggregate& orig);
113 
114 };


Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)