C++ TargetRTS
Loading...
Searching...
No Matches
RTConnector.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 __RTConnector_h__
11#define __RTConnector_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTActor_h__
18#include <RTActor.h>
19#endif
20
21#ifndef __RTCachedString_h__
22#include <RTCachedString.h>
23#endif
24
25#ifndef __RTLayerData_h__
26#include <RTLayerData.h>
27#endif
28
29extern const RTActorClass RTConnector;
30
32{
33public:
35 virtual ~RTConnector_Actor( void );
36
37 virtual void enumerate( void ) const = 0;
38
39 // The implementations of these two operations use the following six
40 // operations which are similar to the old API. Subclasses are encouraged
41 // to provide their own implementations of these operations as this will
42 // likely yield a more efficient solution.
43
44 virtual RTLayerData * _registerSAP( RTController * _context,
45 RTProtocol * _sap,
46 const char * _name );
47
48 virtual RTLayerData * _registerSPP( RTController * _context,
49 RTProtocol * _spp,
50 const char * _name );
51
52 // The following six operations provide (near) backward compatibility.
53 // RTProtocol::getRegisteredName will return nil during the registration
54 // operations which is why they have an additional parameter.
55
56 virtual int registerSAP ( RTController * _context,
57 RTProtocol * _sap,
58 const char * _name ) = 0;
59
60 virtual void resizeSAP ( RTController * _context,
61 RTProtocol * _sap,
62 int _old_size ) = 0;
63
64 virtual void deregisterSAP( RTController * _context,
65 RTProtocol * _sap ) = 0;
66
67 virtual int registerSPP ( RTController * _context,
68 RTProtocol * _spp,
69 const char * _name ) = 0;
70
71 virtual void resizeSPP ( RTController * _context,
72 RTProtocol * _spp,
73 int _old_size ) = 0;
74
75 virtual void deregisterSPP( RTController * _context,
76 RTProtocol * _spp ) = 0;
77
78 static const RTActor_class rtg_class;
79
80private:
81 class SapData : public RTLayerData
82 {
83 public:
84 SapData( RTConnector_Actor *,
85 RTProtocol *,
86 const char * );
87 virtual ~SapData( void );
88
89 virtual const char * getRegisteredName( void ) const override;
90
91 virtual void resize( RTController * context, int old_size ) override;
92
93 virtual void deregister( RTController * context ) override;
94
95 private:
96 RTConnector_Actor * _connector;
97 RTProtocol * _sap;
98 RTCachedString _name;
99 }; //lint !e1712
100
101 class SppData : public RTLayerData
102 {
103 public:
104 SppData( RTConnector_Actor *,
105 RTProtocol *,
106 const char * );
107 virtual ~SppData( void );
108
109 virtual const char * getRegisteredName( void ) const override;
110
111 virtual void resize( RTController * context, int old_size ) override;
112
113 virtual void deregister( RTController * context ) override;
114
115 private:
116 RTConnector_Actor * _connector;
117 RTProtocol * _spp;
118 RTCachedString _name;
119 }; //lint !e1712
120
121 // unavailable methods
123 RTConnector_Actor & operator=( const RTConnector_Actor & );
124}; //lint !e1712
125
126#endif // __RTConnector_h__
An instance of this class represents a capsule instance.
Definition: RTActor.h:44
RTController * context(void) const
Get the controller which runs this capsule instance.
Definition: RTActor.inl:130
Represents a capsule part.
Definition: RTActorRef.h:39
Definition: RTCachedString.h:22
Definition: RTConnector.h:32
A controller manages a group of capsule instances that all run in the same physical thread (i....
Definition: RTController.h:54
Definition: RTLayerData.h:24
Represents a general capsule port typed by a protocol which determines the set of events that can be ...
Definition: RTProtocol.h:50
Definition: RTActor_class.h:49
A type descriptor providing information about the external characteristics of a capsule.
Definition: RTActorClass.h:36