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

4.104.114.84.95
Last change on this file since 4f021c0 was 0074691a, checked in by Joel Sherrill <joel.sherrill@…>, on 07/31/97 at 22:13:29

Merged very large and much appreciated patch from Chris Johns
<cjohns@…>. This patch includes the ods68302 bsp,
the RTEMS++ class library, and the rtems++ test.

  • Property mode set to 100644
File size: 1.5 KB
Line 
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
30class rtemsStatusCode
31{
32public:
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
47protected:
48  const rtems_status_code set_status_code(const rtems_status_code status)
49  { return (last_status = status); }
50 
51private:
52 
53  // public at the moment, this might change
54  rtems_status_code last_status;
55};
56
57#endif  // _rtemsStatusCode_h_
Note: See TracBrowser for help on using the repository browser.