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