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

Last change on this file since f288708 was 0c6c31b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:46:06

2003-09-04 Joel Sherrill <joel@…>

  • include/rtems++/rtemsEvent.h, include/rtems++/rtemsInterrupt.h, include/rtems++/rtemsMessageQueue.h, include/rtems++/rtemsSemaphore.h, include/rtems++/rtemsStatusCode.h, include/rtems++/rtemsTask.h, include/rtems++/rtemsTaskMode.h, include/rtems++/rtemsTimer.h, src/rtemsEvent.cc, src/rtemsInterrupt.cc, src/rtemsMessageQueue.cc, src/rtemsSemaphore.cc, src/rtemsStatusCode.cc, src/rtemsTask.cc, src/rtemsTimer.cc: URL for license changed.
  • 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.rtems.com/license/LICENSE.
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.