MAK RTIspy API Documentation for HLA 4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HLAopaqueData.h
Go to the documentation of this file.
1 #pragma once
2 /***********************************************************************
3  The IEEE hereby grants a general, royalty-free license to copy, distribute,
4  display and make derivative works from this material, for all purposes,
5  provided that any use of the material contains the following
6  attribution: "Reprinted with permission from IEEE 1516.1(TM)-2025".
7  Should you require additional information, contact the Manager, Standards
8  Intellectual Property, IEEE Standards Association (stds-ipr@ieee.org).
9 ***********************************************************************/
10 
13 #include <RTI/SpecificConfig.h>
14 
15 namespace rti1516_2025
16 {
17  // Forward Declarations
18  class VariableLengthData;
19  class HLAopaqueDataImplementation;
20 
21  // Interface for the HLAopaqueData basic data element
23  {
24  public:
25 
26  // Constructor: Default
27  // Uses internal memory
28  HLAopaqueData ();
29 
30  // Constructor: Initial Value
31  // Uses internal memory
33  const Octet* inData,
34  size_t dataSize);
35 
36  // Constructor: Use external memory with buffer and data of given lengths.
37  // This instance changes or reflects changes to contents of external memory.
38  // Changes to external memory are reflected in subsequent encodings.
39  // Changes to encoder (i.e., set or decode) are reflected in external memory.
40  // Caller is responsible for ensuring that the external memory is
41  // valid for the lifetime of this object or until this object acquires
42  // new memory through setDataPointer.
43  // Buffer length indicates size of memory; data length indicates size of
44  // data stored in memory.
45  // Exception is thrown for null memory or zero buffer size.
48  Octet** inData,
49  size_t bufferSize,
50  size_t dataSize);
51 
52  // Constructor: Copy
53  // Uses internal memory
55  HLAopaqueData const & rhs);
56 
57  // Caller is free to delete rhs.
58  ~HLAopaqueData() override;
59 
60  // Return a new copy of the DataElement
61  std::unique_ptr<DataElement> clone () const override;
62 
63  // Return the encoding of this element in a VariableLengthData
65  VariableLengthData encode () const override;
66 
67  // Encode this element into an existing VariableLengthData
69  void encode (
70  VariableLengthData& inData) const override;
71 
72  // Encode this element and append it to a buffer.
74  void encodeInto (
75  std::vector<Octet>& buffer) const override;
76 
77  // Decode this element from the RTI's VariableLengthData.
79  HLAopaqueData& decode (
80  VariableLengthData const & inData) override;
81 
82  // Decode this element starting at the index in the provided buffer
84  size_t decodeFrom (
85  std::vector<Octet> const & buffer,
86  size_t index) override;
87 
88  // Return the size in bytes of this element's encoding.
90  size_t getEncodedLength () const override;
91 
92  // Return the octet boundary of this element.
93  unsigned int getOctetBoundary () const override;
94 
95  // Return the length of the contained buffer
96  virtual size_t bufferLength () const;
97 
98  // Return the length of the data stored in the buffer
99  virtual size_t dataLength () const;
100 
101  // Change memory to use given external memory
102  // Changes to this instance will be reflected in external memory
103  // Caller is responsible for ensuring that the data that is
104  // pointed to is valid for the lifetime of this object, or past
105  // the next time this object is given new data.
106  // Buffer length indicates size of memory; data length indicates size of
107  // data stored in memory.
108  // Exception is thrown for null memory or zero buffer size.
110  virtual HLAopaqueData& setDataPointer (
111  Octet** inData,
112  size_t bufferSize,
113  size_t dataSize);
114 
115  // Set the data to be encoded.
116  virtual HLAopaqueData& set(
117  const Octet* inData,
118  size_t dataSize);
119 
120  // Return a reference to the contained array
121  virtual const Octet* get () const;
122 
123  // Assignment Operator not allowed
124  HLAopaqueData& operator=(
125  HLAopaqueData const & rhs) = delete;
126 
127  protected:
128 
129  HLAopaqueDataImplementation* _impl;
130  };
131 }
132 
133 
134 
#define RTI_EXPORT
Definition: SpecificConfig.h:45
HLAopaqueDataImplementation * _impl
Definition: HLAopaqueData.h:129
Definition: HLAopaqueData.h:22
Definition: DataElement.h:23
Integer8 Octet
Definition: EncodingConfig.h:49
This file contains definitions that are used to isolate platform-specific elements of the API...
Definition: VariableLengthData.h:28

Document ID: Generated on Wed Jul 8 16:20:32 EDT 2026 from SVN revision 291616
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)