Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlStringMessage.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 __igtlStringMessage_h
16#define __igtlStringMessage_h
17
18#include <string>
19
20#include "igtlObject.h"
21#include "igtlMath.h"
22#include "igtlMessageBase.h"
23#include "igtlTypes.h"
24
25#define IGTL_STRING_MESSAGE_DEFAULT_ENCODING 3 /* Default encoding -- ANSI-X3.5-1968 */
26
27namespace igtl
28{
29
32{
33public:
38
41
42public:
43
45 int SetString(const char* string);
46
48 int SetString(std::string & string);
49
53 int SetEncoding(igtlUint16 enc);
54
56 const char* GetString();
57
60 igtlUint16 GetEncoding();
61
62protected:
65
66protected:
67
68 virtual int GetBodyPackSize();
69 virtual int PackBody();
70 virtual int UnpackBody();
71
74 igtlUint16 m_Encoding;
75
77 std::string m_String;
78
79};
80
81
82} // namespace igtl
83
84#endif // _igtlStringMessage_h
85
86
87
Implements transparent reference counting.
THe STRING message type is used for transferring a character string. It supports character strings up...
int SetString(const char *string)
Sets the string by character array.
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
int SetString(std::string &string)
Sets the string by std::string.
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
igtlUint16 GetEncoding()
std::string m_String
The string.
virtual int GetBodyPackSize()
Gets the size of the serialized body.
SmartPointer< Self > Pointer
igtlTypeMacro(igtl::StringMessage, igtl::MessageBase)
int SetEncoding(igtlUint16 enc)
SmartPointer< const Self > ConstPointer
igtlNewMacro(igtl::StringMessage)
const char * GetString()
Gets the string.
#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