C++ TargetRTS
Loading...
Searching...
No Matches
RTLayerConnector.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 __RTLayerConnector_h__
11#define __RTLayerConnector_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTCachedString_h__
18#include <RTCachedString.h>
19#endif
20
21#ifndef __RTDictionary_h__
22#include <RTDictionary.h>
23#endif
24
25#ifndef __RTLayerData_h__
26#include <RTLayerData.h>
27#endif
28
29struct RTBindingEnd;
30class RTProtocol;
31class RTQueue;
32
34{
35public:
36 // static features
37
39 {
40 RTS_INLINE NameBuffer( void );
41 NameBuffer( const NameBuffer & );
42 RTS_INLINE ~NameBuffer( void );
43 NameBuffer & operator=( const NameBuffer & );
44
45 const char * value;
46 char * large_buffer;
47 char small_buffer[ 80 ];
48 };
49
50 static const char defaultService[];
51 static void parseService( const char *, NameBuffer & );
52 static const char * parseName( const char * );
53
54 static void lock( void );
55 static void unlock( void );
56
57 static void showSAPs( void );
58
59 static RTLayerData * registerSAP( RTController *,
60 RTProtocol *,
61 const char * );
62
63 static RTLayerData * registerSPP( RTController *,
64 RTProtocol *,
65 const char * );
66
67 static void cleanup( void );
68
69 enum CheckOption { CheckNow, CheckedAlready };
70
71 static void bind ( RTController *, RTBindingEnd &,
73 CheckOption = CheckNow );
74 static void unbind( RTController *, RTBindingEnd & );
75 static void unbind( RTController *, RTProtocol & );
76
77 // instance features
78
79 RTLayerConnector( void );
80 virtual ~RTLayerConnector( void );
81
82 int install ( RTController *, const char * name );
83 int uninstall( RTController *, const char * name );
84
85 virtual RTLayerData * _registerSAP( RTController *,
86 RTProtocol *,
87 const char * ) = 0;
88
89 virtual RTLayerData * _registerSPP( RTController *,
90 RTProtocol *,
91 const char * ) = 0;
92
93 virtual void _enumerate( void ) const = 0;
94
95private:
96 class Pending : public RTLayerData
97 {
98 public:
99 Pending( RTQueue *, RTProtocol *, const char * );
100 virtual ~Pending( void );
101
102 virtual const char * getRegisteredName( void ) const override;
103
104 virtual void resize( RTController * context, int old_size ) override;
105
106 virtual void deregister( RTController * context ) override;
107
108 int size( void ) const;
109
110 RTQueue * queue;
111 RTProtocol * port;
112 RTCachedString name;
113 }; //lint !e1712
114
115 static RTDictionary connectors;
116 static RTDictionary pendingSAPs;
117 static RTDictionary pendingSPPs;
118
119 static int total_replication( const RTQueue * queue );
120
121 // unavailable methods
123 RTLayerConnector & operator=( const RTLayerConnector & );
124}; //lint !e1712
125
126#if RTS_INLINES
127#include <RTLayerConnector.inl>
128#endif
129
130#endif // __RTLayerConnector_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
Represents a general capsule port typed by a protocol which determines the set of events that can be ...
Definition: RTProtocol.h:50
Definition: RTQueue.h:22
Definition: RTBindingEnd.h:24
Definition: RTLayerConnector.h:39