Go to the documentation of this file.00001
00002
00003
00004
00005
00008
00009 #if DtHLA
00010 #ifndef hlaTimeStampedAttr_H_
00011 #define hlaTimeStampedAttr_H_
00012
00013 #include "lgrSim.h"
00014
00015 #include "absoluteTime.h"
00016
00017 #include <vl/rtiNamespace.h>
00018
00019 namespace MAKLogger
00020 {
00021 class DtLgrHlaMessage;
00022
00023 typedef DtU32 DtLgrHlaHandle;
00024
00027 class DT_DLL_LGRSIM DtHlaTimeStampedAttribute
00028 {
00029
00030 public:
00031
00033 DtHlaTimeStampedAttribute(DtAbsoluteTime time,
00034 DtLgrHlaHandle handle,int size,const void* value) :
00035 myTime(time),
00036 myHandle(handle),
00037 mySize(0),
00038 myValue(0)
00039 {
00040 setValue(size,value);
00041 }
00042
00043 ~DtHlaTimeStampedAttribute()
00044 {
00045 delete[] myValue;
00046 }
00047
00048 inline DtAbsoluteTime time() const
00049 {
00050 return myTime;
00051 }
00052
00053 inline DtLgrHlaHandle handle() const
00054 {
00055 return myHandle;
00056 }
00057
00058 inline int size() const
00059 {
00060 return mySize;
00061 }
00062
00063 inline const void* value() const
00064 {
00065 return myValue;
00066 }
00067
00068 inline void setValue(int sz,const void* val)
00069 {
00070 if(sz != mySize)
00071 {
00072 delete[] myValue;
00073 mySize = sz;
00074 myValue = new char[mySize];
00075 }
00076 memcpy(myValue,val,sz);
00077 }
00078
00079 private:
00081 DtHlaTimeStampedAttribute(const DtHlaTimeStampedAttribute&);
00083 DtHlaTimeStampedAttribute& operator=(const DtHlaTimeStampedAttribute&);
00084
00085 protected:
00086
00087 DtAbsoluteTime myTime;
00088 DtLgrHlaHandle myHandle;
00089 int mySize;
00090 char* myValue;
00091 };
00092 }
00093
00094 #endif
00095 #endif