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  Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink2_beta/Source/igtlBindMessage.h $
5  Language: C++
6  Date: $Date: 2009-12-16 23:58:02 -0500 (Wed, 16 Dec 2009) $
7  Version: $Revision: 5466 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notices for more information.
14 
15 =========================================================================*/
16 
17 #ifndef __igtlBindMessage_h
18 #define __igtlBindMessage_h
19 
20 #include <string>
21 
22 #include "igtlObject.h"
23 #include "igtlMath.h"
24 #include "igtlMessageBase.h"
25 #include "igtlTypes.h"
26 
27 namespace igtl
28 {
29 //
30 // Base class for BindMessage, GetBindMessage and StartBindMessage
31 //
33 {
34 public:
39 
42 
43 public:
44 
45  void Init();
46 
47  int SetNumberOfChildMessages(unsigned int n);
48  int GetNumberOfChildMessages();
49 
50  int AppendChildMessage(igtl::MessageBase * child);
51  int SetChildMessage(unsigned int i, igtl::MessageBase * child);
52 
53  const char* GetChildMessageType(unsigned int i);
54 
55 protected:
56 
58  ~BindMessageBase();
59 
60 protected:
61 
62  typedef struct {
63  std::string type;
64  std::string name;
65  igtlUint64 size;
66  void * ptr;
68 
69  std::vector<ChildMessageInfo> m_ChildMessages;
70 
71 };
72 
73 
75 {
76 public:
77  typedef BindMessage Self;
81 
84 
85 public:
86 
87  int GetChildMessage(unsigned int i, igtl::MessageBase * child);
88 
89 protected:
90  BindMessage();
91  ~BindMessage();
92 
93 protected:
94 
95  virtual int GetBodyPackSize();
96  virtual int PackBody();
97  virtual int UnpackBody();
98 
99 };
100 
101 
103 {
104 public:
109 
112 
113 public:
114 
115  int AppendChildMessage(const char * type, const char * name);
116 
117 protected:
118  GetBindMessage();
119  ~GetBindMessage();
120 
121 protected:
122 
123  virtual int GetBodyPackSize();
124  virtual int PackBody();
125  virtual int UnpackBody();
126 
127 };
128 
129 
131 {
132 public:
137 
140 
141 public:
142 
143  // Set/get time resolution. The time resolution is specified
144  // as a 64-bit fixed-point used in OpenIGTLink time stamp.
145  void SetResolution(igtlUint64 res);
146  igtlUint64 GetResolution();
147 
148 protected:
150  ~StartBindMessage();
151 
152 protected:
153 
154  virtual int GetBodyPackSize();
155  virtual int PackBody();
156  virtual int UnpackBody();
157 
158  igtlUint64 m_Resolution;
159 
160 };
161 
162 
164 {
165 public:
170 
173 
174 protected:
175  StopBindMessage() : MessageBase() { this->m_DefaultBodyType = "STP_BIND"; };
177 
178 protected:
179  virtual int GetBodyPackSize() { return 0; };
180  virtual int PackBody() { AllocatePack(); return 1; };
181  virtual int UnpackBody() { return 1; };
182 
183 };
184 
185 
187 {
188 public:
193 
194  // Status type
195  enum {
196  STATUS_SUCCESS = 0,
197  STATUS_ERROR = 1
198  };
199 
200 
203 
204  void SetStatus(igtlUint8 status){ this->m_Status = status; }
205  igtlUint8 GetStatus() { return this->m_Status; };
206 
207 protected:
208  RTSBindMessage() : MessageBase(), m_Status(0) { this->m_DefaultBodyType = "RTS_BIND"; };
210 
211  igtlUint8 m_Status;
212 
213 protected:
214  virtual int GetBodyPackSize();
215  virtual int PackBody();
216  virtual int UnpackBody();
217 
218 };
219 
220 
221 
222 } // namespace igtl
223 
224 #endif // _igtlBindMessage_h
225 
226 
227 
228 

Generated at Thu Mar 20 2014 16:32:06 for OpenIGTLink by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2000