igtlStatusMessage.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __igtlStatusMessage_h
00018 #define __igtlStatusMessage_h
00019
00020 #include "igtlObject.h"
00021
00022 #include "igtlMath.h"
00023 #include "igtlMessageBase.h"
00024 #include "igtlTypes.h"
00025
00026 namespace igtl
00027 {
00028
00029 class IGTLCommon_EXPORT StatusMessage: public MessageBase
00030 {
00031 public:
00032 typedef StatusMessage Self;
00033 typedef MessageBase Superclass;
00034 typedef SmartPointer<Self> Pointer;
00035 typedef SmartPointer<const Self> ConstPointer;
00036
00037 igtlTypeMacro(igtl::StatusMessage, igtl::MessageBase);
00038 igtlNewMacro(igtl::StatusMessage);
00039
00040 public:
00041
00042
00043 enum {
00044 STATUS_INVALID = 0,
00045 STATUS_OK = 1,
00046 STATUS_UNKNOWN_ERROR = 2,
00047 STATUS_PANICK_MODE = 3,
00048 STATUS_NOT_FOUND = 4,
00049 STATUS_ACCESS_DENIED = 5,
00050 STATUS_BUSY = 6,
00051 STATUS_TIME_OUT = 7,
00052 STATUS_OVERFLOW = 8,
00053 STATUS_CHECKSUM_ERROR = 9,
00054 STATUS_CONFIG_ERROR = 10,
00055 STATUS_RESOURCE_ERROR = 11,
00056 STATUS_UNKNOWN_INSTRUCTION = 12,
00057 STATUS_NOT_READY = 13,
00058 STATUS_MANUAL_MODE = 14,
00059 STATUS_DISABLED = 15,
00060 STATUS_NOT_PRESENT = 16,
00061 STATUS_UNKNOWN_VERSION = 17,
00062 STATUS_HARDWARE_FAILURE = 18,
00063 STATUS_SHUT_DOWN = 19,
00064 STATUS_NUM_TYPES = 20
00065 };
00066
00067 public:
00068
00069 void SetCode(int code);
00070 int GetCode();
00071 void SetSubCode(igtlInt64 subcode);
00072 igtlInt64 GetSubCode();
00073
00074 void SetErrorName(const char* name);
00075 const char* GetErrorName();
00076
00077 void SetStatusString(const char* str);
00078 const char* GetStatusString();
00079
00080 protected:
00081 StatusMessage();
00082 ~StatusMessage();
00083
00084 protected:
00085
00086 virtual int GetBodyPackSize();
00087 virtual int PackBody();
00088 virtual int UnpackBody();
00089
00090 igtlUint16 m_Code;
00091 igtlInt64 m_SubCode;
00092 char m_ErrorName[20];
00093
00094
00095 std::string m_StatusMessageString;
00096
00097
00098 unsigned char* m_StatusHeader;
00099 char* m_StatusMessage;
00100
00101 };
00102
00103
00104 }
00105
00106 #endif // _igtlStatusMessage_h
00107
00108
00109
00110