vxwErr.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:1k
源码类别:

VxWorks

开发平台:

C/C++

  1. // VXWError/vxwErr.h - error handling class
  2. // Copyright 1995-1999 Wind River Systems, Inc.
  3. //
  4. // modification history
  5. // --------------------
  6. // 01c,08jun99,dgp  doc: add descrip for correct refgen processing
  7. // 01b,23feb99,fle  doc : made it refgen parsable
  8. // 01a,15jun95,srh  written.
  9. //
  10. // DESCRIPTION
  11. // The `VXWError' class provides a generic error handling facility.
  12. //
  13. // INCLUDE FILE: vxwErr.h
  14. //
  15. // SEE ALSO: <VxWorks Programmer's Guide: C++ Development>
  16. //
  17. #ifndef vxwErr_h
  18. #define vxwErr_h
  19. #include "errnoLib.h"
  20. class VXWError
  21.     {
  22.   public:
  23.     VXWError (const char *);
  24.     VXWError (const int);
  25.     VXWError (const VXWError &);
  26.     virtual ~VXWError ();
  27.     const char * why () const
  28. {
  29. return errorMessage_;
  30. }
  31.   protected:
  32.     VXWError ()
  33. {
  34. }
  35.     void makeCopy (const char * s);
  36.     const char * errorMessage_;
  37.     };
  38. void vxwSetErrHandler (void (*)(const VXWError &));
  39. void vxwThrow (const VXWError & err);
  40. inline void vxwThrowErrno ()
  41.     {
  42.     vxwThrow (VXWError (errnoGet ()));
  43.     }
  44. #endif /* #ifndef vxwErr_h */