MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HLAfixedArray.h
Go to the documentation of this file.
1 /***********************************************************************
2  The IEEE hereby grants a general, royalty-free license to copy, distribute,
3  display and make derivative works from this material, for all purposes,
4  provided that any use of the material contains the following
5  attribution: "Reprinted with permission from IEEE 1516.1(TM)-2010".
6  Should you require additional information, contact the Manager, Standards
7  Intellectual Property, IEEE Standards Association (stds-ipr@ieee.org).
8 ***********************************************************************/
9 /***********************************************************************
10  IEEE 1516.1 High Level Architecture Interface Specification C++ API
11  File: HLAfixedArray.h
12 ***********************************************************************/
13 #ifndef RTI_HLAfixedArray_h_
14 #define RTI_HLAfixedArray_h_
15 
18 #include <RTI/SpecificConfig.h>
19 
20 namespace rti1516e
21 {
22  // Forward Declarations
23  class VariableLengthData;
24  class HLAfixedArrayImplementation;
25 
26  // Interface for the HLAfixedArray complex data element
28  {
29  public:
30  // Constructor which accepts a prototype element and size
31  // that specifies the type and number of elements to be stored in the array.
32  // A clone of the given element works as a prototype.
33  explicit HLAfixedArray (
34  const DataElement& protoType,
35  size_t length );
36 
37  // Copy Constructor
38  // Copied elements use internal memory
40  HLAfixedArray const & rhs);
41 
42  // Destructor
43  virtual ~HLAfixedArray();
44 
45  // Return a new copy of the array
46  virtual std::auto_ptr<DataElement> clone () const;
47 
48  // Encode this element into a new VariableLengthData
49  virtual VariableLengthData encode () const
50  throw (EncoderException);
51 
52  // Encode this element into an existing VariableLengthData
53  virtual void encode (
54  VariableLengthData& inData) const
55  throw (EncoderException);
56 
57  // Encode this element and append it to a buffer
58  virtual void encodeInto (
59  std::vector<Octet>& buffer) const
60  throw (EncoderException);
61 
62  // Decode this element from the RTI's VariableLengthData.
63  virtual void decode (
64  VariableLengthData const & inData)
65  throw (EncoderException);
66 
67  // Decode this element starting at the index in the provided buffer
68  virtual size_t decodeFrom (
69  std::vector<Octet> const & buffer,
70  size_t index)
71  throw (EncoderException);
72 
73  // Return the size in bytes of this element's encoding.
74  virtual size_t getEncodedLength () const
75  throw (EncoderException);
76 
77  // Return the octet boundary of this element.
78  virtual unsigned int getOctetBoundary () const;
79 
80  // Return true if given element is same type as this; otherwise, false.
81  virtual bool isSameTypeAs(
82  DataElement const& inData ) const;
83 
84  // Return true if given element matches prototype of this array.
85  virtual bool hasPrototypeSameTypeAs(DataElement const& dataElement ) const;
86 
87  // Return the number of elements in this fixed array.
88  virtual size_t size () const;
89 
90  // Sets the element at the given index to a copy of the given element instance
91  // Element must match prototype.
92  // If indexed element uses external memory, the memory will be modified.
93  virtual void set (size_t index,
94  const DataElement& dataElement)
95  throw (EncoderException);
96 
97  // Sets the element at the given index to the given element instance
98  // Element must match prototype.
99  // Null pointer results in an exception.
100  // Caller is responsible for ensuring that the external memory is
101  // valid for the lifetime of this object or until the indexed element
102  // acquires new memory through this call.
103  virtual void setElementPointer (size_t index,
104  DataElement* dataElement)
105  throw (EncoderException);
106 
107  // Return a reference to the element instance at the specified index.
108  // Access of indexed element that has not been set will set that index
109  // with a clone of prototype and return it.
110  // Must use set to change element.
111  virtual const DataElement& get (
112  size_t index) const
113  throw (EncoderException);
114 
115  // Return a const reference to the element instance at the specified index.
116  // Access of indexed element that has not been set will set that index
117  // with a clone of prototype and return it.
118  // Must use set to change element.
119  DataElement const& operator [](size_t index) const
120  throw (EncoderException);
121 
122  private:
123 
124  // Default Constructor not allowed
125  HLAfixedArray ();
126 
127  // Assignment Operator not allowed
128  HLAfixedArray& operator=(
129  HLAfixedArray const & rhs);
130 
131  protected:
132 
133  HLAfixedArrayImplementation* _impl;
134  };
135 }
136 
137 #endif // RTI_HLAfixedArray_h_
138 

Document ID: Generated on Mon Mar 21 09:41:37 EDT 2016 from SVN revision 163228
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)