[0074691a] | 1 | /* |
---|
| 2 | ------------------------------------------------------------------------ |
---|
| 3 | $Id$ |
---|
| 4 | ------------------------------------------------------------------------ |
---|
| 5 | |
---|
| 6 | COPYRIGHT (c) 1997 |
---|
| 7 | Objective Design Systems Ltd Pty (ODS) |
---|
| 8 | All rights reserved (R) Objective Design Systems Ltd Pty |
---|
| 9 | |
---|
| 10 | The license and distribution terms for this file may be found in the |
---|
| 11 | file LICENSE in this distribution or at |
---|
| 12 | http://www.OARcorp.com/rtems/license.html. |
---|
| 13 | |
---|
| 14 | ------------------------------------------------------------------------ |
---|
| 15 | |
---|
| 16 | rtemsStatusCode controls and manages status codes from the RTEMS kernel. |
---|
| 17 | |
---|
| 18 | ------------------------------------------------------------------------ |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | #if !defined(_rtemsStatusCode_h_) |
---|
| 22 | #define _rtemsStatusCode_h_ |
---|
| 23 | |
---|
| 24 | #include <rtems.h> |
---|
| 25 | |
---|
| 26 | /* ---- |
---|
| 27 | rtemsStatusCode |
---|
| 28 | */ |
---|
| 29 | |
---|
| 30 | class rtemsStatusCode |
---|
| 31 | { |
---|
| 32 | public: |
---|
| 33 | |
---|
| 34 | rtemsStatusCode() { last_status = RTEMS_NOT_CONFIGURED; } |
---|
| 35 | |
---|
| 36 | const bool successful() { return last_status == RTEMS_SUCCESSFUL; } |
---|
| 37 | const bool unsuccessful() { return last_status != RTEMS_SUCCESSFUL; } |
---|
| 38 | |
---|
| 39 | // return the last status code |
---|
| 40 | const rtems_status_code last_status_code() { return last_status; } |
---|
| 41 | |
---|
| 42 | // return the last status as a string |
---|
| 43 | const char *last_status_string(); |
---|
| 44 | |
---|
| 45 | const char *status_string(rtems_status_code status_code); |
---|
| 46 | |
---|
| 47 | protected: |
---|
| 48 | const rtems_status_code set_status_code(const rtems_status_code status) |
---|
| 49 | { return (last_status = status); } |
---|
| 50 | |
---|
| 51 | private: |
---|
| 52 | |
---|
| 53 | // public at the moment, this might change |
---|
| 54 | rtems_status_code last_status; |
---|
| 55 | }; |
---|
| 56 | |
---|
| 57 | #endif // _rtemsStatusCode_h_ |
---|