10 #if !defined(DtIFSPEC13) && !defined(DtIFSPEC1516)
13 #pragma warning( disable : 4290 )
16 #ifndef HLAvariableArrayImpl_H_
17 #define HLAvariableArrayImpl_H_
19 #include <RTI/encoding/DataElement.h>
20 #include <RTI/encoding/BasicDataElements.h>
44 virtual VariableLengthData
encode()
const;
48 virtual void encode(VariableLengthData& inData)
const;
52 virtual void encodeInto( std::vector<Octet>& buffer )
const;
56 virtual void decode(VariableLengthData
const & inData);
61 virtual size_t decodeFrom( std::vector<Octet>
const & buffer,
size_t index );
73 virtual size_t size()
const;
83 virtual void addElement(
const DataElement& dataElement)
84 throw (EncoderException);
89 virtual void addElementPointer(DataElement* dataElement,
bool takeOwnership=
false)
90 throw (EncoderException);
94 virtual void set (
size_t index,
const DataElement& dataElement)
95 throw (EncoderException);
100 virtual void setElementPointer (
size_t index, DataElement* dataElement,
bool takeOwnership=
false)
101 throw (EncoderException);
106 virtual const DataElement&
get(
size_t index)
const;
111 virtual DataElement&
get(
size_t index);
124 virtual void clear( );
143 mutable std::vector<DataElement*>
myData;
HLAinteger32BE myLength
Length of the array.
Definition: HLAvariableArrayImpl.h:137
virtual ~HLAvariableArrayImplementation()
Destructor.
virtual void setElementPointer(size_t index, DataElement *dataElement, bool takeOwnership=false)
Set the indexed element to the given dataElement instance all array elements must have same type Null...
virtual size_t decodeFrom(std::vector< Octet > const &buffer, size_t index)
Decode this element starting at the index in the provided buffer.
size_t myEncodedLength
size of the encoded length
Definition: HLAvariableArrayImpl.h:155
Definition: HLAvariableArrayImpl.h:28
size_t myOctetBoundary
size of the octet boundary
Definition: HLAvariableArrayImpl.h:152
virtual void encodeInto(std::vector< Octet > &buffer) const
Encode this element and append it to a buffer.
virtual size_t size() const
Return the number of elements in this variable array.
virtual void addElementPointer(DataElement *dataElement, bool takeOwnership=false)
Adds the given element instance to this variable array all array elements must have same type Null po...
virtual unsigned int getOctetBoundary() const
Return the octet boundary of this element.
DtRtiApiUniquePtr< DataElement > myPrototypeElement
prototype
Definition: HLAvariableArrayImpl.h:140
HLAvariableArrayImplementation()
Default constructor not allowed.
virtual void clear()
Empty and delete memory for existing elements.
virtual void decode(VariableLengthData const &inData)
Decode this element from the VariableLengthData.
virtual void set(size_t index, const DataElement &dataElement)
Set the indexed element to a copy of the given dataElement instance all array elements must have same...
bool myDirtyState
flag for checking dirty state
Definition: HLAvariableArrayImpl.h:149
virtual size_t getEncodedLength() const
Return the size in bytes of this element's encoding.
std::vector< DataElement * > myData
mutable array of data element pointers
Definition: HLAvariableArrayImpl.h:143
std::vector< bool > myDataOwnership
array of ownership, for deleting objects properly
Definition: HLAvariableArrayImpl.h:146
virtual VariableLengthData encode() const
Encode this element into a new VariableLengthData.
virtual void addElement(const DataElement &dataElement)
Adds a copy of the given element instance to this array all array elements must have same type...
virtual bool hasPrototypeSameTypeAs(DataElement const &dataElement) const
Return true if given element matches prototype of array.
virtual size_t resetEncodedLength()
Reset the cached length if it has changed.
virtual const DataElement & prototypeElement() const
Return the prototype element.