C++ TargetRTS
Loading...
Searching...
No Matches
RTExternal.h
1/*
2 * Licensed Materials - Property of HCL and/or IBM
3 * Copyright HCL Technologies Ltd. 2016, 2021. All Rights Reserved.
4 * Copyright IBM Corporation 1999, 2016. All Rights Reserved.
5 *
6 * U.S. Government Users Restricted Rights - Use, duplication or
7 * disclosure restricted by GSA ADP Schedule.
8 */
9
10#ifndef __RTExternal_h__
11#define __RTExternal_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTInSignal_h__
18#include <RTInSignal.h>
19#endif
20
21#ifndef __RTProtocol_h__
22#include <RTProtocol.h>
23#endif
24
25struct RTExternalData;
26
30{
34 class Base : public RTProtocol
35 {
36 public:
37 static const RTProtocolDescriptor rt_class;
38
39 RTS_INLINE Base(void);
40 ~Base(void);
41
42 enum
43 {
44 rti_event = rtiLast_RTProtocol + 1
45 };
46
52 void enable(int prio = System);
53
57 void disable(void);
58
71 int raise(const void * data = nullptr, const RTObject_class * type = nullptr);
72
81 void dataPushBack(void* data);
82
91 unsigned int dataPopFront(void** data);
92
101 unsigned int dataPopBack(void** data);
102
110 void dataDelete(void* data);
111
115 RTS_INLINE RTInSignal event(void);
116
117 protected:
118 enum
119 {
120 rtiLast_External = rti_event
121 };
122
123 private:
124 RTMessage * msg;
125
126 RTMessage * unload(void);
127
128 static const RTSignalDescriptor rt_signals[];
129
130 RTExternalData* externalData;
131
132 // unavailable methods
133 Base(const Base &);
134 Base & operator=(const Base &);
135 };
136};
137
138#if RTS_INLINES
139#include <RTExternal.inl>
140#endif
141
142#endif // __RTExternal_h__
Represents a port through which an external thread can safely communicate with its owner capsule.
Definition: RTExternal.h:35
int raise(const void *data=nullptr, const RTObject_class *type=nullptr)
Send an event on the external port.
void dataPushBack(void *data)
Store a data object on the external port.
unsigned int dataPopBack(void **data)
Pop the last data object off the list of objects stored on the external port.
void disable(void)
Disable the owner capsule from receiving an event on the external port.
unsigned int dataPopFront(void **data)
Pop the first data object off the list of objects stored on the external port.
RTInSignal event(void)
Return the object that represents the event which can be sent to the external port by an external thr...
Definition: RTExternal.inl:28
void enable(int prio=System)
Enable the owner capsule to receive an event on the external port.
void dataDelete(void *data)
Attempt to find a specific data object in the list of objects stored on the external port.
Represents a message used for communication between capsule instances.
Definition: RTMessage.h:33
Represents a general capsule port typed by a protocol which determines the set of events that can be ...
Definition: RTProtocol.h:50
Represents the predefined "External" protocol.
Definition: RTExternal.h:30
Provides the API for working with messages of a certain protocol event received on a certain port.
Definition: RTInSignal.h:34
A type descriptor providing information about a type.
Definition: RTObject_class.h:64
Definition: RTProtocolDescriptor.h:40
Definition: RTSignalDescriptor.h:32