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
25namespace igtl
26{
27
29{
30public:
35
38
39protected:
40 GetCapabilityMessage() : MessageBase() { this->m_DefaultBodyType = "GET_CAPABIL"; };
42protected:
43 virtual int GetBodyPackSize() { return 0; };
44 virtual int PackBody() { AllocatePack(); return 1; };
45 virtual int UnpackBody() { return 1; };
46};
47
48
50{
51
52public:
53
58
61
62public:
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
74protected:
77
78protected:
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
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
std::vector< std::string > GetTypes()
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
const char * GetType(int id)
igtlTypeMacro(igtl::CapabilityMessage, igtl::MessageBase)
SmartPointer< const Self > ConstPointer
virtual int GetBodyPackSize()
Gets the size of the serialized body.
igtlNewMacro(igtl::CapabilityMessage)
void SetTypes(std::vector< std::string > types)
int SetType(int id, const char *name)
SmartPointer< Self > Pointer
std::vector< std::string > m_TypeNames
igtlNewMacro(igtl::GetCapabilityMessage)
SmartPointer< const Self > ConstPointer
virtual int GetBodyPackSize()
Gets the size of the serialized body.
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
igtlTypeMacro(igtl::GetCapabilityMessage, igtl::MessageBase)
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
Implements transparent reference counting.
#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