Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlStatusMessage.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: The OpenIGTLinkLibrary
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 __igtlStatusMessage_h
16#define __igtlStatusMessage_h
17
18#include "igtlObject.h"
19#include "igtlMath.h"
20#include "igtlMessageBase.h"
21#include "igtlTypes.h"
22
23namespace igtl
24{
25
26
43
44
54{
55public:
60
63
64public:
65
67 enum {
68 STATUS_INVALID = 0,
69 STATUS_OK = 1,
70 STATUS_UNKNOWN_ERROR = 2,
71 STATUS_PANICK_MODE = 3, /* emergency */
72 STATUS_NOT_FOUND = 4, /* file, configuration, device etc */
73 STATUS_ACCESS_DENIED = 5,
74 STATUS_BUSY = 6,
75 STATUS_TIME_OUT = 7, /* Time out / Connection lost */
76 STATUS_OVERFLOW = 8, /* Overflow / Can't be reached */
77 STATUS_CHECKSUM_ERROR = 9, /* Checksum error */
78 STATUS_CONFIG_ERROR = 10, /* Configuration error */
79 STATUS_RESOURCE_ERROR = 11, /* Not enough resource (memory, storage etc) */
80 STATUS_UNKNOWN_INSTRUCTION = 12, /* Illegal/Unknown instruction */
81 STATUS_NOT_READY = 13, /* Device not ready (starting up)*/
82 STATUS_MANUAL_MODE = 14, /* Manual mode (device does not accept commands) */
83 STATUS_DISABLED = 15, /* Device disabled */
84 STATUS_NOT_PRESENT = 16, /* Device not present */
85 STATUS_UNKNOWN_VERSION = 17, /* Device version not known */
86 STATUS_HARDWARE_FAILURE = 18, /* Hardware failure */
87 STATUS_SHUT_DOWN = 19, /* Exiting / shut down in progress */
88 STATUS_NUM_TYPES = 20
89 };
90
91public:
92
94 void SetCode(int code);
95
97 int GetCode();
98
100 void SetSubCode(igtlInt64 subcode);
101
103 igtlInt64 GetSubCode();
104
106 void SetErrorName(const char* name);
107
109 const char* GetErrorName();
110
112 void SetStatusString(const char* str);
113
115 const char* GetStatusString();
116
117protected:
120
121protected:
122
123 virtual int GetBodyPackSize();
124 virtual int PackBody();
125 virtual int UnpackBody();
126
128 igtlUint16 m_Code;
129
131 igtlInt64 m_SubCode;
132
134 char m_ErrorName[20];
135
138
140 unsigned char* m_StatusHeader;
141
144
145};
146
147
148} // namespace igtl
149
150#endif // _igtlStatusMessage_h
151
152
153
A class for the GET_STATUS message type.
HeaderOnlyMessageBase Superclass
SmartPointer< Self > Pointer
igtlNewMacro(igtl::GetStatusMessage)
SmartPointer< const Self > ConstPointer
igtlTypeMacro(igtl::GetStatusMessage, igtl::HeaderOnlyMessageBase)
A class for header-only message types, which are used for quearying.
Implements transparent reference counting.
const char * GetErrorName()
Gets the error name.
void SetErrorName(const char *name)
Sets the error name. The error name can be defined by a developer.
igtlTypeMacro(igtl::StatusMessage, igtl::MessageBase)
void SetStatusString(const char *str)
Sets the status string.
void SetSubCode(igtlInt64 subcode)
Sets the sub code.
igtlNewMacro(igtl::StatusMessage)
SmartPointer< Self > Pointer
int GetCode()
Gets the status code.
char * m_StatusMessage
A pointer to the byte array of the status message.
virtual int GetBodyPackSize()
Gets the size of the serialized body.
unsigned char * m_StatusHeader
A pointer to the byte array of the status header.
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
igtlUint16 m_Code
The error code.
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
igtlInt64 GetSubCode()
Gets the sub code.
void SetCode(int code)
Sets the status code.
const char * GetStatusString()
Gets the status string.
std::string m_StatusMessageString
The status message string.
SmartPointer< const Self > ConstPointer
igtlInt64 m_SubCode
The sub code.
#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