![]() |
MAK RTIspy API Documentation for HLA 1516
|
00001 /*********************************************************************** 00002 The IEEE hereby grants a general, royalty-free license to copy, distribute, 00003 display and make derivative works from this material, for all purposes, 00004 provided that any use of the material contains the following 00005 attribution: "Reprinted with permission from IEEE 1516.1(TM)-2010". 00006 Should you require additional information, contact the Manager, Standards 00007 Intellectual Property, IEEE Standards Association (stds-ipr@ieee.org). 00008 ***********************************************************************/ 00009 /*********************************************************************** 00010 IEEE 1516.1 High Level Architecture Interface Specification C++ API 00011 File: HLAfixedRecord.h 00012 ***********************************************************************/ 00013 #ifndef RTI_HLAfixedRecord_h_ 00014 #define RTI_HLAfixedRecord_h_ 00015 00016 #include <RTI/encoding/DataElement.h> 00017 #include <RTI/encoding/EncodingConfig.h> 00018 #include <RTI/SpecificConfig.h> 00019 00020 namespace rti1516e 00021 { 00022 // Forward Declarations 00023 class VariableLengthData; 00024 class HLAfixedRecordImplementation; 00025 00026 // Interface for the HLAfixedRecord complex data element 00027 class RTI_EXPORT HLAfixedRecord : public rti1516e::DataElement 00028 { 00029 public: 00030 00031 // Default Constructor 00032 HLAfixedRecord (); 00033 00034 // Copy Constructor 00035 HLAfixedRecord ( 00036 HLAfixedRecord const & rhs); 00037 00038 // Destructor 00039 virtual ~HLAfixedRecord (); 00040 00041 // Return a new copy of the DataElement 00042 virtual std::auto_ptr<DataElement> clone () const; 00043 00044 // Encode this element into a new VariableLengthData 00045 virtual VariableLengthData encode () const 00046 throw (EncoderException); 00047 00048 // Encode this element into an existing VariableLengthData 00049 virtual void encode ( 00050 VariableLengthData& inData) const 00051 throw (EncoderException); 00052 00053 // Encode this element and append it to a buffer 00054 virtual void encodeInto ( 00055 std::vector<Octet>& buffer) const 00056 throw (EncoderException); 00057 00058 // Decode this element from the RTI's VariableLengthData. 00059 virtual void decode ( 00060 VariableLengthData const & inData) 00061 throw (EncoderException); 00062 00063 // Decode this element starting at the index in the provided buffer 00064 virtual size_t decodeFrom ( 00065 std::vector<Octet> const & buffer, 00066 size_t index) 00067 throw (EncoderException); 00068 00069 // Return the size in bytes of this record's encoding. 00070 virtual size_t getEncodedLength () const 00071 throw (EncoderException); 00072 00073 // Return the octet boundary of this element. 00074 virtual unsigned int getOctetBoundary () const; 00075 00076 // Return true if given element is same type as this; otherwise, false. 00077 virtual bool isSameTypeAs( 00078 DataElement const& inData ) const; 00079 00080 // Return true if given element is same type as the indexed element; 00081 // otherwise, false. 00082 virtual bool hasElementSameTypeAs(size_t index, 00083 DataElement const& inData ) const; 00084 00085 // Return the number of elements in this fixed record. 00086 virtual size_t size () const; 00087 00088 // Append a copy of the dataElement instance to this fixed record. 00089 virtual void appendElement (const DataElement& dataElement); 00090 00091 // Append the dataElement instance to this fixed record. 00092 // Null pointer results in an exception. 00093 virtual void appendElementPointer (DataElement* dataElement); 00094 00095 // Sets the element at the given index to a copy of the given element instance 00096 // Element must match prototype of existing element at this index. 00097 virtual void set (size_t index, 00098 const DataElement& dataElement) 00099 throw (EncoderException); 00100 00101 // Sets the element at the given index to the given element instance 00102 // Element must match prototype of existing element at this index. 00103 // Null pointer results in an exception. 00104 virtual void setElementPointer (size_t index, DataElement* dataElement) 00105 throw (EncoderException); 00106 00107 // Return a const reference to the element at the specified index. 00108 // Must use set to change element. 00109 virtual const DataElement& get ( 00110 size_t index) const 00111 throw (EncoderException); 00112 00113 // Return a const reference to the element instance at the specified index. 00114 // Must use set to change element. 00115 DataElement const& operator [](size_t index) const 00116 throw (EncoderException); 00117 00118 private: 00119 00120 // Assignment Operator not allowed 00121 HLAfixedRecord& operator=( 00122 HLAfixedRecord const & rhs); 00123 00124 protected: 00125 00126 HLAfixedRecordImplementation* _impl; 00127 }; 00128 } 00129 00130 #endif // RTI_HLAfixedRecord_h_ 00131