C++ TargetRTS
Loading...
Searching...
No Matches
RTProtocolDescriptor.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 __RTProtocolDescriptor_h__
11#define __RTProtocolDescriptor_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTVersionId_h__
18#include <RTVersionId.h>
19#endif
20
21struct RTObject_class;
23
24// A protocol is described by a pair of these structures: one for each of
25// the conjugated and unconjugated perspectives. All signals, including
26// ones inherited but not those excluded, are counted and listed in order
27// sorted by name.
28//
29// Field Meaning
30// ----- -------
31// super The superclass descriptor.
32// conjugate The conjugate descriptor.
33// name The name of the protocol.
34// version The version identifier.
35// numInSignals The number of 'in' signals.
36// The 'out' signals are listed in the conjugate.
37// inSignals The array of signal descriptors.
38
40{
41 const RTProtocolDescriptor * super;
42 const RTProtocolDescriptor * conjugate;
43 const char * name;
44 RTVersionId version;
45
46 int numInSignals;
47 const RTSignalDescriptor * inSignals;
48 // 'out' signals are listed in conjugate->inSignals
49
50 const char * inSignalName( int signal ) const;
51 int inSignalNamed( const char * ) const;
52
53 RTS_INLINE
54 const char * outSignalName( int signal ) const;
55 RTS_INLINE
56 int outSignalNamed( const char * ) const;
57
58 enum Status
59 {
60 ok,
61 badSignal,
62 badType
63 };
64
65 Status compare( const RTProtocolDescriptor * ) const;
66 RTS_INLINE int compatibleWith( const RTProtocolDescriptor * ) const;
67
68 RTS_INLINE
69 Status canSend( int signal, const RTObject_class * type ) const;
70 Status canReceive( int signal, const RTObject_class * type ) const;
71};
72
73#if RTS_INLINES
74#include <RTProtocolDescriptor.inl>
75#endif
76
77#endif // __RTProtocolDescriptor_h__
A type descriptor providing information about a type.
Definition: RTObject_class.h:64
Definition: RTProtocolDescriptor.h:40
Definition: RTSignalDescriptor.h:32