15 #ifndef __igtlMessageBase_h 16 #define __igtlMessageBase_h 69 UNPACK_UNDEF = 0x0000,
70 UNPACK_HEADER = 0x0001,
77 void SetDeviceName(
const char* name);
80 const char* GetDeviceName();
83 const char* GetDeviceType();
86 int SetTimeStamp(
unsigned int sec,
unsigned int frac);
89 int GetTimeStamp(
unsigned int* sec,
unsigned int* frac);
115 int Unpack(
int crccheck = 0);
118 void* GetPackPointer();
121 void* GetPackBodyPointer();
127 int GetPackBodySize();
169 virtual void AllocatePack(
int bodySize);
239 virtual int PackBody() { AllocatePack();
return 1; };
248 #define igtlCreateDefaultQueryMessageClass(name, msgtype) \ 249 class IGTLCommon_EXPORT name : public HeaderOnlyMessageBase\ 253 typedef HeaderOnlyMessageBase Superclass; \ 254 typedef SmartPointer<Self> Pointer; \ 255 typedef SmartPointer<const Self> ConstPointer; \ 257 igtlTypeMacro(igtl::name, igtl::HeaderOnlyMessageBase); \ 258 igtlNewMacro(igtl::name); \ 261 name() : HeaderOnlyMessageBase() { this->m_DefaultBodyType = msgtype; }; \ 267 #endif // _igtlMessageBase_h
std::string m_DeviceName
A character string for the device name (message name).
unsigned int m_TimeStampSec
SmartPointer< Self > Pointer
#define igtlTypeMacro(thisClass, superclass)
std::string m_DefaultBodyType
A character string for the default device type (message type).
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
const char * GetBodyType()
GetBodyType() gets the type of the body.
virtual int SetMessageHeader(const MessageHeader *mb)
Sets the message header.
int m_IsBodyUnpacked
Unpacking (desrialization) status for the body (0: – 1: unpacked).
virtual int GetBodyPackSize()
Gets the size of the serialized body.
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
unsigned int m_TimeStampSecFraction
int m_IsHeaderUnpacked
Unpacking (desrialization) status for the header (0: – 1: unpacked).
class MessageBase MessageHeader
SmartPointer< const Self > ConstPointer
Base class for most igtl classes.