Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlCapabilityMessage.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: The OpenIGTLink Library
4  Language: C++
5 
6  Copyright (c) Insight Software Consortium. All rights reserved.
7 
8  This software is distributed WITHOUT ANY WARRANTY; without even
9  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10  PURPOSE. See the above copyright notices for more information.
11 
12 =========================================================================*/
13 
14 #ifndef __igtlCapabilityMessage_h
15 #define __igtlCapabilityMessage_h
16 
17 #include <igtlObject.h>
18 #include <igtlMath.h>
19 #include <igtlMessageBase.h>
20 #include <igtlTypes.h>
21 
22 #include <vector>
23 #include <string>
24 
25 namespace igtl
26 {
27 
29 {
30 public:
35 
38 
39 protected:
40  GetCapabilityMessage() : MessageBase() { this->m_DefaultBodyType = "GET_CAPABIL"; };
42 protected:
43  virtual int GetBodyPackSize() { return 0; };
44  virtual int PackBody() { AllocatePack(); return 1; };
45  virtual int UnpackBody() { return 1; };
46 };
47 
48 
50 {
51 
52 public:
53 
58 
61 
62 public:
63 
64  //void SetTypes(int ntypes, const char names[][IGTL_HEADER_TYPE_SIZE]);
65  void SetTypes(std::vector<std::string> types);
66  int SetType(int id, const char* name);
67  const char* GetType(int id);
68 
69  void SetNumberOfTypes(int n) { m_TypeNames.resize(n); }
70  int GetNumberOfTypes() { return m_TypeNames.size(); }
71  //char** GetTypeNames() { return m_TypeNames; }
72  std::vector<std::string> GetTypes() { return m_TypeNames; }
73 
74 protected:
77 
78 protected:
79 
80  virtual int GetBodyPackSize();
81  virtual int PackBody();
82  virtual int UnpackBody();
83 
84  std::vector<std::string> m_TypeNames;
85 
86 };
87 
88 
89 } // namespace igtl
90 
91 #endif // __igtlCapabilityMessage_h
SmartPointer< const Self > ConstPointer
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
SmartPointer< Self > Pointer
#define IGTLCommon_EXPORT
std::vector< std::string > GetTypes()
#define igtlNewMacro(x)
Definition: igtlMacro.h:431
std::vector< std::string > m_TypeNames
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
SmartPointer< const Self > ConstPointer
virtual int GetBodyPackSize()
Gets the size of the serialized body.

Generated at Tue Nov 3 2015 19:17:46 for OpenIGTLink by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2012