MAK RTIspy API Documentation for HLA 1.3
HLAvariableArrayImpl.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2010 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: HLAvariableArrayImpl.h,v $ $Revision: 1.0 $ $State: Exp $
7 *********************************************************************/
10 #ifdef DtIFSPEC1516E
11 
12 #ifdef WIN32
13 #pragma warning( disable : 4290 )
14 #endif
15 
16 #ifndef HLAvariableArrayImpl_H_
17 #define HLAvariableArrayImpl_H_
18 
21 #include "encodingImplHelpers.h"
22 #include <memory>
23 
24 namespace rti1516e
25 {
26  class HLAvariableArrayImplementation
27  {
28  public:
29 
32  HLAvariableArrayImplementation( const DataElement& dataElement );
33 
35  HLAvariableArrayImplementation(HLAvariableArrayImplementation const & rhs);
36 
38  virtual ~HLAvariableArrayImplementation();
39 
42  virtual rti1516e::VariableLengthData encode() const;
43 
46  virtual void encode(rti1516e::VariableLengthData& inData) const;
47 
50  virtual void encodeInto( std::vector<Octet>& buffer ) const;
51 
54  virtual void decode(rti1516e::VariableLengthData const & inData);
55 
59  virtual size_t decodeFrom( std::vector<Octet> const & buffer, size_t index );
60 
63  virtual size_t getEncodedLength() const;
64 
67  virtual unsigned int getOctetBoundary() const;
68 
71  virtual size_t size() const;
72 
74  virtual bool hasPrototypeSameTypeAs(DataElement const& dataElement ) const;
75 
77  virtual bool hasPrototypeSameTypeAs(HLAvariableArrayImplementation const* inData ) const;
78 
81  virtual void addElement(const DataElement& dataElement)
82  throw (EncoderException);
83 
87  virtual void addElementPointer(DataElement* dataElement, bool takeOwnership=false)
88  throw (EncoderException);
89 
92  virtual void set (size_t index, const DataElement& dataElement)
93  throw (EncoderException);
94 
98  virtual void setElementPointer (size_t index, DataElement* dataElement, bool takeOwnership=false)
99  throw (EncoderException);
100 
104  virtual const rti1516e::DataElement& get(size_t index) const;
105 
109  virtual rti1516e::DataElement& get(size_t index);
110 
112  virtual const rti1516e::DataElement& prototypeElement() const;
113 
114  protected:
115 
118  virtual size_t resetEncodedLength( );
119 
122  virtual void clear( );
123 
125  HLAvariableArrayImplementation* self() const;
126 
127  private:
128 
130  HLAvariableArrayImplementation();
131 
132  private:
133 
135  HLAinteger32BE myLength;
136 
138  std::auto_ptr<rti1516e::DataElement> myPrototypeElement;
139 
141  mutable std::vector<rti1516e::DataElement*> myData;
142 
144  mutable std::vector<bool> myDataOwnership;
145 
147  bool myDirtyState;
148 
150  size_t myOctetBoundary;
151 
153  size_t myEncodedLength;
154  };
155 }
156 
157 #endif
158 #endif // DtIFSPEC1516E
159 
160 
161 

Document ID: Generated on Tue May 7 16:26:47 EDT 2013 from SVN revision 126903
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)