VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extAggregateStateRepository.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 
15 #include <vl/aggregateStateRepository.h>
16 #include <vector>
17 
20 {
21 public:
22 
25 
28 
30  virtual void updateDataRecords(DtAggregateStateRepository*);
31 
33  virtual void decodeDataRecords(DtAggregateStateRepository*);
34 
36  virtual bool readFromRecord(DtVariableDatumRecord&);
37 };
38 
40 {
41 
42 public:
43 
44  // default constructor
46 
47  // destructor
49 
50  // copy constructor
52 
53  // assignment operator
55  const DtExtAggregateStateRepository& orig);
56 
57  // Return a copy/empty object of the same type as this.
58  virtual DtStateRepository* clone(bool copy = false) const;
59 
60  // Compares us against the supplied state repository and returns what's
61  // changed
62  virtual int compare(const DtExtAggregateStateRepository* rhs);
63 
64  // Returns what has changed since the last time we called compare
65  virtual int compareToMostRecent();
66 
67  // Returns true if our stashed location is different than our
68  // current location
69  virtual bool locationsDifferent(bool updateIfDifferent);
70 
73  virtual DtString extendedData(const DtString& key) const;
74 
75  const DtVrfExtendedRecordData& extendedRecordData() const
76  {
77  return myExtendedRecordData;
78  }
79 
80  DtVrfExtendedRecordData& extendedRecordData()
81  {
82  return myExtendedRecordData;
83  }
84 
89  virtual DtString uuidString() const;
90 
91 public:
94  virtual void addEntity(const DtBaseEntityStateRepository*);
95  virtual void removeEntity(const DtBaseEntityStateRepository*);
96 
97  virtual void addAggregate(const DtBaseEntityStateRepository*);
98  virtual void removeAggregate(const DtBaseEntityStateRepository*);
99 
101  virtual void addSubordinate(const DtEntityIdentifier&);
102  virtual void removeSubordinate(const DtEntityIdentifier&);
103 
105  virtual void setExtendedData(const std::map<DtString, DtString>& ed);
106  virtual void setExtendedData(const DtString& key, const DtString& value);
107 
108 public:
112  virtual int numVrfVariableDatumRecords() const;
113 
115  virtual bool getUserVariableDatum(int userRecordNumber,
116  DtVariableDatumRecord& rec);
117 
119  virtual bool setUserVariableDatum(int userRecordNumber,
120  const DtVariableDatumRecord& record);
121 
127  virtual void updateDataRecords();
128 
132  virtual void setSendVrfObjectDataRecord(bool shouldSend);
133  virtual bool shouldSendVrfObjectDataRecord() const;
135 
136 public:
137  // Appearance as read from network or set by user
138  int appearance() const;
139  void setAppearance(int);
140 
141  // Gets/sets the list of subordinates in subordinate order
142  const std::vector<DtEntityIdentifier>& orderedSubordinates() const;
143  virtual void setOrderedSubordinates(const std::vector<DtEntityIdentifier>&);
144 
145  // The name of the current formation of the aggregate.
147  virtual DtString formationName() const;
148  virtual void setFormationName(const DtString& formationName);
150 
151 public:
153  virtual void updateExtensions();
154 
155 public:
156 
157  static DtExtAggregateStateRepository* create();
158 
159 protected:
160  virtual void extensionModified();
161 
162 protected:
165 
167  std::vector<DtEntityIdentifier> myOrderedSubordinates;
168 
173 
175 };
176 
178 {
179  return myAppearance;
180 }
181 
183 {
184  if (i != myAppearance)
185  {
186  myRecordModified = true;
187  myAppearance = i;
188  }
189 }
190 
191 inline const std::vector<DtEntityIdentifier>& DtExtAggregateStateRepository::orderedSubordinates() const
192 {
193  return myOrderedSubordinates;
194 }

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)