MAK RTIspy API Documentation for HLA 4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DataElement.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 
11 #include <RTI/SpecificConfig.h>
14 #include <memory>
15 
16 
17 namespace rti1516_2025
18 {
19  // Forward Declarations
20  class VariableLengthData;
21 
22  // Interface provided by all HLA data elements.
24  {
25  public:
26 
27  // Destructor
28  virtual ~DataElement () = 0;
29 
30  // Return a new copy of the DataElement
31  virtual std::unique_ptr<DataElement> clone () const = 0;
32 
33  // Encode this element into a new VariableLengthData
35  virtual VariableLengthData encode () const = 0;
36 
37  // Encode this element into an existing VariableLengthData
39  virtual void encode (
40  VariableLengthData& inData) const = 0;
41 
42  // Encode this element and append it to a buffer
44  virtual void encodeInto (
45  std::vector<Octet>& buffer) const = 0;
46 
47  // Decode this element from the RTI's VariableLengthData.
49  virtual DataElement& decode (
50  VariableLengthData const & inData) = 0;
51 
52  // Decode this element starting at the index in the provided buffer
54  virtual size_t decodeFrom (
55  std::vector<Octet> const & buffer,
56  size_t index) = 0;
57 
58  // Return the size in bytes of this element's encoding.
60  virtual size_t getEncodedLength () const = 0;
61 
62  // Return the octet boundary of this element.
63  virtual unsigned int getOctetBoundary () const = 0;
64 
65  // Return true if given element is same type as this; otherwise, false.
66  virtual bool isSameTypeAs(
67  DataElement const& inData ) const;
68 
69  // Return a hash of the encoded data
70  // Provides mechanism to map DataElement discriminants to variants
71  // in VariantRecord.
72  virtual Integer64 hash() const;
73 
74  };
75 }
76 
77 
78 
#define RTI_EXPORT
Definition: SpecificConfig.h:45
Definition: DataElement.h:23
long long Integer64
Definition: EncodingConfig.h:41
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)