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 
23 namespace igtl
24 {
25 
26 
29 {
30 public:
35 
38 
39 protected:
40  GetStatusMessage() : HeaderOnlyMessageBase() { this->m_DefaultBodyType = "GET_STATUS"; };
42 };
43 
44 
54 {
55 public:
60 
63 
64 public:
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 
91 public:
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 
117 protected:
118  StatusMessage();
119  ~StatusMessage();
120 
121 protected:
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 header-only message types, which are used for quearying.
char * m_StatusMessage
A pointer to the byte array of the status message.
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
SmartPointer< Self > Pointer
HeaderOnlyMessageBase Superclass
std::string m_StatusMessageString
The status message string.
SmartPointer< const Self > ConstPointer
#define IGTLCommon_EXPORT
A class for the GET_STATUS message type.
igtlUint16 m_Code
The error code.
SmartPointer< const Self > ConstPointer
igtlInt64 m_SubCode
The sub code.
unsigned char * m_StatusHeader
A pointer to the byte array of the status header.
SmartPointer< Self > Pointer
#define igtlNewMacro(x)
Definition: igtlMacro.h:431

Generated at Wed Dec 4 2013 03:48:28 for OpenIGTLink by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2012