diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1997-07-31 22:13:29 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1997-07-31 22:13:29 +0000 |
commit | 0074691a67f857c9b3f880fb581e0af1d5673337 (patch) | |
tree | f80fd23129ad62236ee4f64eeaf537f53bbaa0b8 /c/src/lib/include/rtems++/rtemsStatusCode.h | |
parent | Merged very large and much appreciated patch from Chris Johns (diff) | |
download | rtems-0074691a67f857c9b3f880fb581e0af1d5673337.tar.bz2 |
Merged very large and much appreciated patch from Chris Johns
<cjohns@plessey.com.au>. This patch includes the ods68302 bsp,
the RTEMS++ class library, and the rtems++ test.
Diffstat (limited to 'c/src/lib/include/rtems++/rtemsStatusCode.h')
-rw-r--r-- | c/src/lib/include/rtems++/rtemsStatusCode.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/c/src/lib/include/rtems++/rtemsStatusCode.h b/c/src/lib/include/rtems++/rtemsStatusCode.h new file mode 100644 index 0000000000..fee230868b --- /dev/null +++ b/c/src/lib/include/rtems++/rtemsStatusCode.h @@ -0,0 +1,57 @@ +/* + ------------------------------------------------------------------------ + $Id$ + ------------------------------------------------------------------------ + + COPYRIGHT (c) 1997 + Objective Design Systems Ltd Pty (ODS) + All rights reserved (R) Objective Design Systems Ltd Pty + + The license and distribution terms for this file may be found in the + file LICENSE in this distribution or at + http://www.OARcorp.com/rtems/license.html. + + ------------------------------------------------------------------------ + + rtemsStatusCode controls and manages status codes from the RTEMS kernel. + + ------------------------------------------------------------------------ +*/ + +#if !defined(_rtemsStatusCode_h_) +#define _rtemsStatusCode_h_ + +#include <rtems.h> + +/* ---- + rtemsStatusCode +*/ + +class rtemsStatusCode +{ +public: + + rtemsStatusCode() { last_status = RTEMS_NOT_CONFIGURED; } + + const bool successful() { return last_status == RTEMS_SUCCESSFUL; } + const bool unsuccessful() { return last_status != RTEMS_SUCCESSFUL; } + + // return the last status code + const rtems_status_code last_status_code() { return last_status; } + + // return the last status as a string + const char *last_status_string(); + + const char *status_string(rtems_status_code status_code); + +protected: + const rtems_status_code set_status_code(const rtems_status_code status) + { return (last_status = status); } + +private: + + // public at the moment, this might change + rtems_status_code last_status; +}; + +#endif // _rtemsStatusCode_h_ |