C++ TargetRTS
Loading...
Searching...
No Matches
RTLocalConnector.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 __RTLocalConnector_h__
11#define __RTLocalConnector_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTDictionary_h__
18#include <RTDictionary.h>
19#endif
20
21#ifndef __RTLayerConnector_h__
22#include <RTLayerConnector.h>
23#endif
24
26{
27public:
28 RTLocalConnector( void );
29 virtual ~RTLocalConnector( void );
30
31 virtual RTLayerData * _registerSAP( RTController *,
32 RTProtocol *,
33 const char * ) override;
34
35 virtual RTLayerData * _registerSPP( RTController *,
36 RTProtocol *,
37 const char * ) override;
38
39 virtual void _enumerate( void ) const override;
40
41 // everything that follows should be considered private
42
43 struct Request
44 {
45 Request( RTProtocol * _sap,
46 int _start );
47
48 Request * prev; // These two pointers are used to organize
49 Request * next; // the requests in order of arrival in time.
50
51 Request * chain; // This pointer is used to organize all
52 // requests for a particular SAP.
53
54 RTProtocol * sap; // This is the SAP that would like to be bound.
55
56 int start; // This is the first replication index that
57 // would like to be bound.
58
59 int limit; // This is one more thant the last replication
60 // index that would like to be bound.
61 }; //lint !e1712
62
63 class SppNode;
64
65 class SapNode : public RTLayerData
66 {
67 public:
69 SppNode *,
70 RTProtocol * sap,
71 const char * );
72 virtual ~SapNode( void );
73
74 virtual const char * getRegisteredName( void ) const override;
75
76 virtual void resize( RTController *, int ) override;
77
78 virtual void deregister( RTController * ) override;
79
80 public:
81 Request initial;
82 SapNode * prev;
83 SapNode * next;
84
85 private:
86 SppNode * node;
87 RTCachedString name;
88 }; //lint !e1712
89
90 class SppNode : public RTLayerData
91 {
92 public:
93 explicit SppNode( RTLocalConnector * );
94
95 virtual ~SppNode( void );
96
97 virtual const char * getRegisteredName( void ) const override;
98
99 virtual void resize( RTController *, int ) override;
100
101 virtual void deregister( RTController * ) override;
102
103 RTLayerData * publish( RTController *,
104 RTProtocol *,
105 const char * );
106
107 int sapTotal( void ) const;
108 int sppTotal( void ) const;
109
110 void append( RTController *, Request * );
111 void remove( RTController *, Request * );
112
113 void append( SapNode * );
114 void remove( RTController *, SapNode * );
115
116 private:
117 void connectAll( RTController * );
118
119 RTProtocol * spp;
120 int spp_next;
121
122 SapNode * saps;
123
124 Request * requests;
125 Request * pending;
126
127 RTLocalConnector * connector;
128 RTCachedString name;
129 }; //lint !e1712
130
131private:
132 RTDictionary /* of SppNode */ db;
133
134 friend class SppNode;
135
136 // unavailable methods
138 RTLocalConnector & operator=( const RTLocalConnector & );
139}; //lint !e1712
140
141#endif // __RTLocalConnector_h__
Definition: RTCachedString.h:22
A controller manages a group of capsule instances that all run in the same physical thread (i....
Definition: RTController.h:54
Definition: RTDictionary.h:22
Definition: RTLayerConnector.h:34
Definition: RTLayerData.h:24
Definition: RTLocalConnector.h:66
Definition: RTLocalConnector.h:91
Definition: RTLocalConnector.h:26
Represents a general capsule port typed by a protocol which determines the set of events that can be ...
Definition: RTProtocol.h:50
Definition: RTLocalConnector.h:44