MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
VariableLengthData.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: RTI/VariableLengthData.h
12 ***********************************************************************/
13 
14 #ifndef RTI_VariableLengthData_h
15 #define RTI_VariableLengthData_h
16 
17 #include <RTI/SpecificConfig.h>
18 #include <stddef.h>
19 
20 // A class to hold an arbitrary array of bytes for encoded values,
21 // attribute values, parameter values, etc. The class provides
22 // several ways of setting data, allowing trade offs between
23 // efficiency and memory management responsibility.
24 
25 namespace rti1516e
26 {
27  // Forward declaration for the RTI-internal class
28  // used to implement VariableLengthData
29  class VariableLengthDataImplementation;
30 
31  // Function to delete memory taken by instance of VariableLengthData class
32  typedef void (*VariableLengthDataDeleteFunction)(void* data);
33 
35  {
36  public:
38 
39  // Caller is free to delete inData after the call
41  void const * inData,
42  size_t inSize);
43 
44  // Caller is free to delete rhs after the call
46  VariableLengthData const & rhs);
47 
49 
50  // Caller is free to delete rhs after the call
51  // This instance will revert to internal storage as a result of assignment.
53  operator= (
54  VariableLengthData const & rhs);
55 
56  // This pointer should not be expected to be valid past the
57  // lifetime of this object, or past the next time this object
58  // is given new data
59  void const * data () const;
60 
61  size_t size () const;
62 
63  // Caller is free to delete inData after the call
64  void setData (
65  void const * inData,
66  size_t inSize);
67 
68  // Caller is responsible for ensuring that the data that is
69  // pointed to is valid for the lifetime of this object, or past
70  // the next time this object is given new data.
71  void setDataPointer (
72  void* inData,
73  size_t inSize);
74 
75  // Caller gives up ownership of inData to this object.
76  // This object assumes the responsibility of deleting inData
77  // when it is no longer needed.
78  // The allocation of inData is assumed to have been through an array
79  // alloctor (e.g., char* data = new char[20]. If the data was allocated
80  // in some other fashion, a deletion function must be supplied.
81  void takeDataPointer (
82  void* inData,
83  size_t inSize,
85 
86  private:
87 
88  // Friend declaration for an RTI-internal class that
89  // can access the implementation of a VariableLengthValue
90  friend class VariableLengthDataFriend;
91 
92  VariableLengthDataImplementation* _impl;
93  };
94 }
95 
96 #endif // RTI_VariableLengthData_h

Document ID: Generated on Fri Sep 27 00:57:56 EDT 2019 from SVN revision 201708
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)