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: Open IGT Link Library
4  Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlStatusMessage.h $
5  Language: C++
6  Date: $Date: 2009-12-16 23:58:02 -0500 (Wed, 16 Dec 2009) $
7  Version: $Revision: 5466 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notices for more information.
14 
15 =========================================================================*/
16 
17 #ifndef __igtlStatusMessage_h
18 #define __igtlStatusMessage_h
19 
20 #include "igtlObject.h"
21 //#include "igtlMacros.h"
22 #include "igtlMath.h"
23 #include "igtlMessageBase.h"
24 #include "igtlTypes.h"
25 
26 namespace igtl
27 {
28 
30 {
31 public:
36 
39 
40 public:
41 
42  /* Status codes -- see igtl_status.h */
43  enum {
44  STATUS_INVALID = 0,
45  STATUS_OK = 1,
46  STATUS_UNKNOWN_ERROR = 2,
47  STATUS_PANICK_MODE = 3, /* emergency */
48  STATUS_NOT_FOUND = 4, /* file, configuration, device etc */
49  STATUS_ACCESS_DENIED = 5,
50  STATUS_BUSY = 6,
51  STATUS_TIME_OUT = 7, /* Time out / Connection lost */
52  STATUS_OVERFLOW = 8, /* Overflow / Can't be reached */
53  STATUS_CHECKSUM_ERROR = 9, /* Checksum error */
54  STATUS_CONFIG_ERROR = 10, /* Configuration error */
55  STATUS_RESOURCE_ERROR = 11, /* Not enough resource (memory, storage etc) */
56  STATUS_UNKNOWN_INSTRUCTION = 12, /* Illegal/Unknown instruction */
57  STATUS_NOT_READY = 13, /* Device not ready (starting up)*/
58  STATUS_MANUAL_MODE = 14, /* Manual mode (device does not accept commands) */
59  STATUS_DISABLED = 15, /* Device disabled */
60  STATUS_NOT_PRESENT = 16, /* Device not present */
61  STATUS_UNKNOWN_VERSION = 17, /* Device version not known */
62  STATUS_HARDWARE_FAILURE = 18, /* Hardware failure */
63  STATUS_SHUT_DOWN = 19, /* Exiting / shut down in progress */
64  STATUS_NUM_TYPES = 20
65  };
66 
67 public:
68 
69  void SetCode(int code);
70  int GetCode();
71  void SetSubCode(igtlInt64 subcode);
72  igtlInt64 GetSubCode();
73 
74  void SetErrorName(const char* name);
75  const char* GetErrorName();
76 
77  void SetStatusString(const char* str);
78  const char* GetStatusString();
79 
80 protected:
81  StatusMessage();
82  ~StatusMessage();
83 
84 protected:
85 
86  virtual int GetBodyPackSize();
87  virtual int PackBody();
88  virtual int UnpackBody();
89 
90  igtlUint16 m_Code;
91  igtlInt64 m_SubCode;
92  char m_ErrorName[20];
93 
94  //BTX
95  std::string m_StatusMessageString;
96  //ETX
97 
98  unsigned char* m_StatusHeader;
100 
101 };
102 
103 
104 } // namespace igtl
105 
106 #endif // _igtlStatusMessage_h
107 
108 
109 
110 

Generated at Thu Mar 20 2014 16:32:06 for OpenIGTLink by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2000