source: rtems/c/src/librtems++/include/rtems++/rtemsStatusCode.h @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on Mar 20, 2014 at 9:10:47 PM

Change all references of rtems.com to rtems.org.

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