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.
00001 /*=========================================================================
00002 
00003   Program:   Open IGT Link Library
00004   Module:    $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlStatusMessage.h $
00005   Language:  C++
00006   Date:      $Date: 2009-12-16 23:58:02 -0500 (Wed, 16 Dec 2009) $
00007   Version:   $Revision: 5466 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010 
00011   This software is distributed WITHOUT ANY WARRANTY; without even
00012   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00013   PURPOSE.  See the above copyright notices for more information.
00014 
00015 =========================================================================*/
00016 
00017 #ifndef __igtlStatusMessage_h
00018 #define __igtlStatusMessage_h
00019 
00020 #include "igtlObject.h"
00021 //#include "igtlMacros.h"
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   /* Status codes -- see igtl_status.h */
00043   enum {
00044     STATUS_INVALID             = 0,
00045     STATUS_OK                  = 1,
00046     STATUS_UNKNOWN_ERROR       = 2,
00047     STATUS_PANICK_MODE         = 3,  /* emergency */
00048     STATUS_NOT_FOUND           = 4,  /* file, configuration, device etc */
00049     STATUS_ACCESS_DENIED       = 5,
00050     STATUS_BUSY                = 6,
00051     STATUS_TIME_OUT            = 7,  /* Time out / Connection lost */
00052     STATUS_OVERFLOW            = 8,  /* Overflow / Can't be reached */
00053     STATUS_CHECKSUM_ERROR      = 9,  /* Checksum error */
00054     STATUS_CONFIG_ERROR        = 10, /* Configuration error */
00055     STATUS_RESOURCE_ERROR      = 11, /* Not enough resource (memory, storage etc) */
00056     STATUS_UNKNOWN_INSTRUCTION = 12, /* Illegal/Unknown instruction */
00057     STATUS_NOT_READY           = 13, /* Device not ready (starting up)*/
00058     STATUS_MANUAL_MODE         = 14, /* Manual mode (device does not accept commands) */
00059     STATUS_DISABLED            = 15, /* Device disabled */
00060     STATUS_NOT_PRESENT         = 16, /* Device not present */
00061     STATUS_UNKNOWN_VERSION     = 17, /* Device version not known */
00062     STATUS_HARDWARE_FAILURE    = 18, /* Hardware failure */
00063     STATUS_SHUT_DOWN           = 19, /* Exiting / shut down in progress */
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   //BTX
00095   std::string  m_StatusMessageString;
00096   //ETX
00097 
00098   unsigned char*  m_StatusHeader;
00099   char*           m_StatusMessage;
00100 
00101 };
00102 
00103 
00104 } // namespace igtl
00105 
00106 #endif // _igtlStatusMessage_h
00107 
00108 
00109 
00110 

Generated at Sat Dec 3 2011 08:54:21 for OpenIGTLink by doxygen 1.7.4 written by Dimitri van Heesch, © 1997-2000