MAK RTIspy API Documentation for HLA 1.3
HLAopaqueData.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: HLAopaqueData.h
12 ***********************************************************************/
13 #ifndef RTI_HLAopaqueData_h_
14 #define RTI_HLAopaqueData_h_
15 
18 #include <RTI/SpecificConfig.h>
19 
20 namespace rti1516e
21 {
22  // Forward Declarations
23  class VariableLengthData;
24  class HLAopaqueDataImplementation;
25 
26  // Interface for the HLAopaqueData basic data element
28  {
29  public:
30 
31  // Constructor: Default
32  // Uses internal memory
33  HLAopaqueData ();
34 
35  // Constructor: Initial Value
36  // Uses internal memory
38  const Octet* inData,
39  size_t dataSize);
40 
41  // Constructor: Use external memory with buffer and data of given lengths.
42  // This instance changes or reflects changes to contents of external memory.
43  // Changes to external memory are reflected in subsequent encodings.
44  // Changes to encoder (i.e., set or decode) are reflected in external memory.
45  // Caller is responsible for ensuring that the external memory is
46  // valid for the lifetime of this object or until this object acquires
47  // new memory through setDataPointer.
48  // Buffer length indicates size of memory; data length indicates size of
49  // data stored in memory.
50  // Exception is thrown for null memory or zero buffer size.
52  Octet** inData,
53  size_t bufferSize,
54  size_t dataSize)
55  throw (EncoderException);
56 
57  // Constructor: Copy
58  // Uses internal memory
60  HLAopaqueData const & rhs);
61 
62  // Caller is free to delete rhs.
63  virtual ~HLAopaqueData();
64 
65  // Return a new copy of the DataElement
66  virtual std::auto_ptr<DataElement> clone () const;
67 
68  // Return the encoding of this element in a VariableLengthData
69  virtual VariableLengthData encode () const
70  throw (EncoderException);
71 
72  // Encode this element into an existing VariableLengthData
73  virtual void encode (
74  VariableLengthData& inData) const
75  throw (EncoderException);
76 
77  // Encode this element and append it to a buffer.
78  virtual void encodeInto (
79  std::vector<Octet>& buffer) const
80  throw (EncoderException);
81 
82  // Decode this element from the RTI's VariableLengthData.
83  virtual void decode (
84  VariableLengthData const & inData)
85  throw (EncoderException);
86 
87  // Decode this element starting at the index in the provided buffer
88  virtual size_t decodeFrom (
89  std::vector<Octet> const & buffer,
90  size_t index)
91  throw (EncoderException);
92 
93  // Return the size in bytes of this element's encoding.
94  virtual size_t getEncodedLength () const
95  throw (EncoderException);
96 
97  // Return the octet boundary of this element.
98  virtual unsigned int getOctetBoundary () const;
99 
100  // Return the length of the contained buffer
101  virtual size_t bufferLength () const;
102 
103  // Return the length of the data stored in the buffer
104  virtual size_t dataLength () const;
105 
106  // Change memory to use given external memory
107  // Changes to this instance will be reflected in external memory
108  // Caller is responsible for ensuring that the data that is
109  // pointed to is valid for the lifetime of this object, or past
110  // the next time this object is given new data.
111  // Buffer length indicates size of memory; data length indicates size of
112  // data stored in memory.
113  // Exception is thrown for null memory or zero buffer size.
114  virtual void setDataPointer (
115  Octet** inData,
116  size_t bufferSize,
117  size_t dataSize)
118  throw (EncoderException);
119 
120  // Set the data to be encoded.
121  virtual void set(
122  const Octet* inData,
123  size_t dataSize);
124 
125  // Return a reference to the contained array
126  virtual const Octet* get () const;
127 
128  // Conversion operator to std::vector<Octet>
129  // Value returned is from encoded data.
130  operator const Octet*() const;
131 
132  private:
133 
134  // Assignment Operator not allowed
135  HLAopaqueData& operator=(
136  HLAopaqueData const & rhs);
137 
138  protected:
139 
140  HLAopaqueDataImplementation* _impl;
141  };
142 }
143 
144 #endif // RTI_HLAopaqueData_h_
145 

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)