Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlBindMessage.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: The OpenIGTLink Library
4 Language: C++
5 Web page: http://openigtlink.org/
6
7 Copyright (c) Insight Software Consortium. All rights reserved.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notices for more information.
12
13=========================================================================*/
14
15#ifndef __igtlBindMessage_h
16#define __igtlBindMessage_h
17
18#include <string>
19
20#include "igtlObject.h"
21#include "igtlMath.h"
22#include "igtlMessageBase.h"
23#include "igtlTypes.h"
24
25namespace igtl
26{
31{
32public:
37
40
41public:
42
44 void Init();
45
48 int SetNumberOfChildMessages(unsigned int n);
49
52
57
60 int SetChildMessage(unsigned int i, igtl::MessageBase * child);
61
63 const char* GetChildMessageType(unsigned int i);
64
65protected:
66
69
70protected:
71
75 typedef struct {
76 std::string type;
77 std::string name;
78 igtlUint64 size;
79 void * ptr;
81
83 std::vector<ChildMessageInfo> m_ChildMessages;
84
85};
86
87
117
118
150
151
189
190
194{
195public:
200
203
204protected:
205 StopBindMessage() : MessageBase() { this->m_SendMessageType = "STP_BIND"; };
207
208protected:
209 virtual int CalculateContentBufferSize() { return 0; };
210 virtual int PackContent() { AllocateBuffer(); return 1; };
211 virtual int UnpackContent() { return 1; };
212
213};
214
215
219{
220public:
225
226 // Status type
227 enum {
228 STATUS_SUCCESS = 0,
229 STATUS_ERROR = 1
230 };
231
234
236 void SetStatus(igtlUint8 status){ this->m_Status = status; }
237
239 igtlUint8 GetStatus() { return this->m_Status; };
240
241protected:
242 RTSBindMessage() : MessageBase(), m_Status(0) { this->m_SendMessageType = "RTS_BIND"; };
244
246 igtlUint8 m_Status;
247
248protected:
250 virtual int PackContent();
251 virtual int UnpackContent();
252
253};
254
255
256
257} // namespace igtl
258
259#endif // _igtlBindMessage_h
int AppendChildMessage(igtl::MessageBase *child)
int SetNumberOfChildMessages(unsigned int n)
SmartPointer< Self > Pointer
igtlNewMacro(igtl::BindMessageBase)
void Init()
Initializes the BindMessageBase class.
int SetChildMessage(unsigned int i, igtl::MessageBase *child)
const char * GetChildMessageType(unsigned int i)
Gets the name of a child message specified by the index 'i'.
igtlTypeMacro(igtl::BindMessageBase, igtl::MessageBase)
std::vector< ChildMessageInfo > m_ChildMessages
A vector to manage a list of ChildMessageInfo structures.
SmartPointer< const Self > ConstPointer
int GetNumberOfChildMessages()
Gets the number of child messages bundled in the message.
A class for the BIND message type.
virtual int CalculateContentBufferSize()
Gets the size of the serialized content.
virtual int UnpackContent()
Unpacks (deserialize) the content. Must be implemented in all child classes.
igtlNewMacro(igtl::BindMessage)
igtlTypeMacro(igtl::BindMessage, igtl::BindMessageBase)
SmartPointer< const Self > ConstPointer
virtual int PackContent()
Packs (serialize) the content. Must be implemented in all child classes.
int GetChildMessage(unsigned int i, igtl::MessageBase *child)
SmartPointer< Self > Pointer
BindMessageBase Superclass
SmartPointer< const Self > ConstPointer
BindMessageBase Superclass
igtlNewMacro(igtl::GetBindMessage)
virtual int UnpackContent()
Unpacks (deserialize) the content. Must be implemented in all child classes.
virtual int CalculateContentBufferSize()
Gets the size of the serialized content.
SmartPointer< Self > Pointer
igtlTypeMacro(igtl::GetBindMessage, igtl::BindMessageBase)
int AppendChildMessage(const char *type, const char *name)
virtual int PackContent()
Packs (serialize) the content. Must be implemented in all child classes.
virtual int UnpackContent()
Unpacks (deserialize) the content. Must be implemented in all child classes.
virtual int PackContent()
Packs (serialize) the content. Must be implemented in all child classes.
virtual int CalculateContentBufferSize()
Gets the size of the serialized content.
igtlNewMacro(igtl::RTSBindMessage)
igtlTypeMacro(igtl::RTSBindMessage, igtl::MessageBase)
igtlUint8 m_Status
Stores the status for the start/stop request.
SmartPointer< Self > Pointer
void SetStatus(igtlUint8 status)
Sets the status for the start/stop request. 'status' must be either RTSBindMessage::STATUS_SUCCESS or...
igtlUint8 GetStatus()
Gets the status for the start/stop request. 'status' must be either RTSBindMessage::STATUS_SUCCESS or...
SmartPointer< const Self > ConstPointer
Implements transparent reference counting.
SmartPointer< Self > Pointer
igtlNewMacro(igtl::StartBindMessage)
virtual int CalculateContentBufferSize()
Gets the size of the serialized content.
virtual int UnpackContent()
Unpacks (deserialize) the content. Must be implemented in all child classes.
void SetResolution(igtlUint64 res)
SmartPointer< const Self > ConstPointer
igtlTypeMacro(igtl::StartBindMessage, igtl::GetBindMessage)
virtual int PackContent()
Packs (serialize) the content. Must be implemented in all child classes.
igtlUint64 GetResolution()
SmartPointer< Self > Pointer
igtlNewMacro(igtl::StopBindMessage)
SmartPointer< const Self > ConstPointer
virtual int CalculateContentBufferSize()
Gets the size of the serialized content.
igtlTypeMacro(igtl::StopBindMessage, igtl::MessageBase)
virtual int PackContent()
Packs (serialize) the content. Must be implemented in all child classes.
virtual int UnpackContent()
Unpacks (deserialize) the content. Must be implemented in all child classes.
#define IGTLCommon_EXPORT
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...

Generated for OpenIGTLink by Doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2012