Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlCommandMessage.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 __igtlCommandMessage_h
16#define __igtlCommandMessage_h
17
18#include "igtlObject.h"
19#include "igtlMacro.h"
20#include "igtlMath.h"
21#include "igtlMessageBase.h"
22#include "igtl_command.h"
23
24namespace igtl
25{
26
28{
29public:
30 static const int validEncodings[257];
31
32public:
37
40
41public:
42
44 int SetCommandId(igtlUint32 aId);
45
47 int SetCommandName(const char* aCommandName);
48
50 int SetCommandName(const std::string& aCommandName);
51
53 int SetCommandContent(const char* string);
54
56 int SetCommandContent(const std::string & string);
57
61 int SetContentEncoding(igtlUint16 enc);
62
64 igtlUint32 GetCommandId() const;
65
67 std::string GetCommandName() const;
68
70 std::string GetCommandContent() const;
71
73 igtlUint32 GetCommandContentLength() const;
74
77 igtlUint16 GetContentEncoding() const;
78
79protected:
82
83protected:
85 virtual int PackContent();
86 virtual int UnpackContent();
87
89 igtlUint32 m_CommandId;
90
92 igtlUint8 m_CommandName[IGTL_COMMAND_NAME_SIZE];
93
96 igtlUint16 m_Encoding;
97
99 std::string m_Command;
100};
101
128
129} // namespace igtl
130
131#endif // _igtlCommandMessage_h
virtual int CalculateContentBufferSize()
Gets the size of the serialized content.
int SetCommandContent(const char *string)
Sets the string by character array.
std::string m_Command
The command stored as an XML encoded string.
igtlUint16 GetContentEncoding() const
igtlUint32 GetCommandContentLength() const
Gets the length of the command content.
std::string GetCommandContent() const
Gets the string.
virtual int PackContent()
Packs (serialize) the content. Must be implemented in all child classes.
SmartPointer< Self > Pointer
int SetContentEncoding(igtlUint16 enc)
std::string GetCommandName() const
Get the command name.
igtlUint32 m_CommandId
The unique ID of the command.
int SetCommandName(const std::string &aCommandName)
Sets the command name by std::string.
SmartPointer< const Self > ConstPointer
int SetCommandId(igtlUint32 aId)
Sets the command ID.
igtlUint32 GetCommandId() const
Gets the command ID.
int SetCommandContent(const std::string &string)
Sets the string by std::string.
int SetCommandName(const char *aCommandName)
Sets the command name.
virtual int UnpackContent()
Unpacks (deserialize) the content. Must be implemented in all child classes.
SmartPointer< Self > Pointer
int SetCommandErrorString(const char *aCommandName)
Sets the error string.
int SetCommandErrorString(const std::string &aCommandName)
Sets the error string by std::string.
std::string GetCommandErrorString() const
Get the error string.
SmartPointer< const Self > ConstPointer
Implements transparent reference counting.
#define igtlTypeMacro(thisClass, superclass)
Definition igtlMacro.h:484
#define igtlNewMacro(x)
Definition igtlMacro.h:431
#define IGTLCommon_EXPORT
#define IGTL_COMMAND_NAME_SIZE
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