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
50 void enable(void);
51
55 void disable(void);
56
69 int raise(const void * data = nullptr, const RTObject_class * type = nullptr);
70
79 void dataPushBack(void* data);
80
89 unsigned int dataPopFront(void** data);
90
99 unsigned int dataPopBack(void** data);
100
108 void dataDelete(void* data);
109
113 RTS_INLINE RTInSignal event(void);
114
115 protected:
116 enum
117 {
118 rtiLast_External = rti_event
119 };
120
121 private:
122 RTMessage * msg;
123
124 RTMessage * unload(void);
125
126 static const RTSignalDescriptor rt_signals[];
127
128 RTExternalData* externalData;
129
130 // unavailable methods
131 Base(const Base &);
132 Base & operator=(const Base &);
133 };
134};
135
136#if RTS_INLINES
137#include <RTExternal.inl>
138#endif
139
140#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 enable(void)
Enable the owner capsule to receive 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 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