source: rtems/c/src/librtems++/src/rtemsEvent.cc @ fa9ef954

4.104.114.84.9
Last change on this file since fa9ef954 was fa9ef954, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2003 at 6:53:21 PM

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.6 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  See header file.
17
18  ------------------------------------------------------------------------
19*/
20
21#include <rtems++/rtemsEvent.h>
22
23/* ----
24    rtemsEvent
25*/
26
27rtemsEvent::rtemsEvent(const char *name_str, rtems_unsigned32 node)
28  : name(rtems_build_name('S', 'E', 'L', 'F')),
29    id(RTEMS_SELF)
30{
31  connect(name_str, node);
32}
33
34rtemsEvent::rtemsEvent(const rtemsEvent& event)
35{
36  name = event.name;
37  id = event.id;
38}
39
40rtemsEvent::rtemsEvent()
41  : name(rtems_build_name('S', 'E', 'L', 'F')),
42    id(RTEMS_SELF)
43{
44}
45
46rtemsEvent::~rtemsEvent()
47{
48}
49
50const rtemsEvent& rtemsEvent::operator=(const rtemsEvent& event)
51{
52  name = event.name;
53  id = event.id;
54
55  return *this;
56}
57
58const rtems_status_code rtemsEvent::connect(const char *name_str,
59                                            const rtems_unsigned32 node)
60{
61  name = rtems_build_name(name_str[0],
62                          name_str[1],
63                          name_str[2],
64                          name_str[3]);
65 
66  set_status_code(rtems_task_ident(name, node, &id));
67
68  if (unsuccessful())
69  {
70    name = rtems_build_name('S', 'E', 'L', 'F');
71    id = RTEMS_SELF;
72  }
73 
74  return last_status_code();
75}
Note: See TracBrowser for help on using the repository browser.