![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2000 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: extAggSR.h,v $ $Revision: 1.14 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00009 #ifndef EXTAGGSR_H 00010 #define EXTAGGSR_H 00011 00012 #include <vl/aggregateSR.h> 00013 #include <vrfExtObjects/vrfExtensions.h> 00014 00015 #include <vector> 00016 00017 // class DtExtAggregateStateRepository: 00018 // 00019 // Instances of DtExtAggregateStateRepository are 00020 00021 #include <vrfExtObjects/vrfExtObjectsDefines.h> 00022 class DT_DLL_vrfExtObjects DtExtAggregateStateRepository : public DtAggregateStateRepository, public DtVrfExtensions 00023 { 00024 00025 public: 00026 00027 // default constructor 00028 DtExtAggregateStateRepository(); 00029 00030 // destructor 00031 virtual ~DtExtAggregateStateRepository(); 00032 00033 // copy constructor 00034 DtExtAggregateStateRepository(const DtExtAggregateStateRepository& orig); 00035 00036 // assignment operator 00037 DtExtAggregateStateRepository& operator=( 00038 const DtExtAggregateStateRepository& orig); 00039 00040 // Return a copy/empty object of the same type as this. 00041 virtual DtStateRepository* clone(bool copy = false) const; 00042 00043 // Compares us against the supplied state repository and returns what's 00044 // changed 00045 virtual int compare(const DtExtAggregateStateRepository* rhs); 00046 00047 // Returns what has changed since the last time we called compare 00048 virtual int compareToMostRecent(); 00049 00050 // Returns true if our stashed location is different than our 00051 // current location 00052 virtual bool locationsDifferent(bool updateIfDifferent); 00053 00054 public: 00057 virtual void addEntity(const DtBaseEntityStateRepository*); 00058 virtual void removeEntity(const DtBaseEntityStateRepository*); 00059 00060 virtual void addAggregate(const DtBaseEntityStateRepository*); 00061 virtual void removeAggregate(const DtBaseEntityStateRepository*); 00062 00064 virtual void addSubordinate(const DtEntityIdentifier&); 00065 virtual void removeSubordinate(const DtEntityIdentifier&); 00066 00067 public: 00071 virtual int numVrfVariableDatumRecords() const; 00072 00074 virtual bool getUserVariableDatum(int userRecordNumber, 00075 DtVariableDatumRecord& rec); 00076 00078 virtual bool setUserVariableDatum(int userRecordNumber, 00079 const DtVariableDatumRecord& record); 00080 00086 virtual void updateDataRecords(); 00087 00088 public: 00089 // Appearance as read from network or set by user 00090 int appearance() const; 00091 void setAppearance(int); 00092 00093 // Gets/sets the list of subordinates in subordinate order 00094 const std::vector<DtEntityIdentifier>& orderedSubordinates() const; 00095 virtual void setOrderedSubordinates(const std::vector<DtEntityIdentifier>&); 00096 00097 // The name of the current formation of the aggregate. 00099 virtual DtString formationName() const; 00100 virtual void setFormationName(const DtString& formationName); 00102 00103 public: 00105 virtual void updateExtensions(); 00106 00107 public: 00108 00109 static DtExtAggregateStateRepository* create(); 00110 00111 protected: 00112 virtual void extensionModified(); 00113 00114 protected: 00115 DtExtAggregateStateRepository* myLastCopy; 00116 00117 int myAppearance; 00118 std::vector<DtEntityIdentifier> myOrderedSubordinates; 00119 00120 char* mySubordinateBuffer; 00121 int myBitLength; 00122 bool myRecordModified; 00123 DtString myFormationName; 00124 }; 00125 00126 inline int DtExtAggregateStateRepository::appearance() const 00127 { 00128 return myAppearance; 00129 } 00130 00131 inline void DtExtAggregateStateRepository::setAppearance(int i) 00132 { 00133 if (i != myAppearance) 00134 { 00135 myRecordModified = true; 00136 myAppearance = i; 00137 } 00138 } 00139 00140 inline const std::vector<DtEntityIdentifier>& DtExtAggregateStateRepository::orderedSubordinates() const 00141 { 00142 return myOrderedSubordinates; 00143 } 00144 00145 #endif