VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
extAggregateStateRepository.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 #include <vl/aggregateStateRepository.h>
12 
13 #include <vector>
14 
17 {
18 public:
21 
24 
26  virtual void updateDataRecords(DtAggregateStateRepository*);
27 
29  virtual void decodeDataRecords(DtAggregateStateRepository*);
30 
32  virtual bool readFromRecord(DtVariableDatumRecord&);
33 };
34 
35 // class DtExtAggregateStateRepository:
36 //
37 // Instances of DtExtAggregateStateRepository are
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 
85 public:
88  virtual void addEntity(const DtBaseEntityStateRepository*);
89  virtual void removeEntity(const DtBaseEntityStateRepository*);
90 
91  virtual void addAggregate(const DtBaseEntityStateRepository*);
92  virtual void removeAggregate(const DtBaseEntityStateRepository*);
93 
95  virtual void addSubordinate(const DtEntityIdentifier&);
96  virtual void removeSubordinate(const DtEntityIdentifier&);
97 
99  virtual void setExtendedData(const std::map<DtString, DtString>& ed);
100  virtual void setExtendedData(const DtString& key, const DtString& value);
101 
102 public:
106  virtual int numVrfVariableDatumRecords() const;
107 
109  virtual bool getUserVariableDatum(int userRecordNumber,
110  DtVariableDatumRecord& rec);
111 
113  virtual bool setUserVariableDatum(int userRecordNumber,
114  const DtVariableDatumRecord& record);
115 
121  virtual void updateDataRecords();
122 
123 public:
124  // Appearance as read from network or set by user
125  int appearance() const;
126  void setAppearance(int);
127 
128  // Gets/sets the list of subordinates in subordinate order
129  const std::vector<DtEntityIdentifier>& orderedSubordinates() const;
130  virtual void setOrderedSubordinates(const std::vector<DtEntityIdentifier>&);
131 
132  // The name of the current formation of the aggregate.
134  virtual DtString formationName() const;
135  virtual void setFormationName(const DtString& formationName);
137 
138 public:
140  virtual void updateExtensions();
141 
142 public:
143 
144  static DtExtAggregateStateRepository* create();
145 
146 protected:
147  virtual void extensionModified();
148 
149 protected:
152 
154  std::vector<DtEntityIdentifier> myOrderedSubordinates;
155 
160 };
161 
163 {
164  return myAppearance;
165 }
166 
168 {
169  if (i != myAppearance)
170  {
171  myRecordModified = true;
172  myAppearance = i;
173  }
174 }
175 
176 inline const std::vector<DtEntityIdentifier>& DtExtAggregateStateRepository::orderedSubordinates() const
177 {
178  return myOrderedSubordinates;
179 }

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)