![]() |
MAK RTIspy API Documentation for HLA 1.3
|
00001 /*********************************************************************** 00002 IEEE 1516.1 High Level Architecture Interface Specification C++ API 00003 File: RTI/VariableLengthData.h 00004 ***********************************************************************/ 00005 00006 #ifndef RTI_VariableLengthData_h 00007 #define RTI_VariableLengthData_h 00008 00009 #include <RTI/SpecificConfig.h> 00010 00011 // A class to hold an arbitrary array of bytes for encoded values, 00012 // attribute values, parameter values, etc. The class provides 00013 // several ways of setting data, allowing tradeoffs between 00014 // efficiency and memory management reponsibility. 00015 00016 namespace rti1516 00017 { 00018 // Forward declaration for the RTI-internal class 00019 // used to implement VariableLengthData 00020 class VariableLengthDataImplementation; 00021 00022 class RTI_EXPORT VariableLengthData 00023 { 00024 public: 00025 VariableLengthData(); 00026 00027 // Caller is free to delete inData after the call 00028 VariableLengthData(void const * inData, unsigned long inSize); 00029 00030 // Caller is free to delete rhs after the call 00031 VariableLengthData(VariableLengthData const & rhs); 00032 00033 ~VariableLengthData(); 00034 00035 // Caller is free to delete rhs after the call 00036 VariableLengthData & 00037 operator=(VariableLengthData const & rhs); 00038 00039 // This pointer should not be expected to be valid past the 00040 // lifetime of this object, or past the next time this object 00041 // is given new data 00042 void const * data() const; 00043 unsigned long size() const; 00044 00045 // Caller is free to delete inData after the call 00046 void setData(void const * inData, unsigned long inSize); 00047 00048 // Caller is responsible for ensuring that the data that is 00049 // pointed to is valid for the lifetime of this object, or past 00050 // the next time this object is given new data. 00051 void setDataPointer(void* inData, unsigned long inSize); 00052 00053 // Caller gives up ownership of inData to this object. 00054 // This object assumes the responsibility of deleting inData 00055 // when it is no longer needed. 00056 void takeDataPointer(void* inData, unsigned long inSize); 00057 00058 private: 00059 00060 // Friend declaration for an RTI-internal class that 00061 // can access the implementation of a VariableLengthValue 00062 friend class VariableLengthDataFriend; 00063 00064 VariableLengthDataImplementation* _impl; 00065 }; 00066 } 00067 00068 #endif // RTI_VariableLengthData_h