'Classic' CCA c++ binding (ccaffeine-only) 0.5.7
cca.h
1#ifndef __CCA_H__
2#define __CCA_H__
3
4#include <string>
5
14#define CONST
19#define ENDSEMI // use of this macro is deprecated
20#define CCA_NAMESPACE_ENDSEMICOLON
21
27#define CFREE
28#define CDELETE
29
33#ifdef NO_PURE_VIRTUAL
34#define CLASSIC_CCA_PURE
35#else
36#define CLASSIC_CCA_PURE = 0
37#endif // NO_PURE_VIRTUAL
38
53namespace classic {
54
55namespace gov {
59 namespace cca {
60
64 class Version {
65 public:
67 static CONST char *name();
69 static CONST char *id();
75 static CONST int Major();
80 static CONST int Minor();
83 static CONST int Patch();
85 };
86
87
88//===================================================================
89
92 class Port {
93 public:
95 virtual ~Port (){}
96 };
97
98//===================================================================
100 class PortInfo {
101 public:
103 virtual ~PortInfo(){}
104
107 virtual CONST char* getType() CONST CLASSIC_CCA_PURE;
108
112 virtual CONST char* getName() CONST CLASSIC_CCA_PURE;
113
116 virtual CONST char* getProperty(char* name) CLASSIC_CCA_PURE;
117
118 };
119
120//===================================================================
123 public:
125 virtual ~ComponentID() {}
126
132 virtual CFREE char* toString() CLASSIC_CCA_PURE;
133
134
135 };
136
137//===================================================================
142 class Services {
143 public:
145 virtual ~Services (){}
146
157 virtual PortInfo * createPortInfo(CONST char *name, CONST char *type, CONST char** properties) CLASSIC_CCA_PURE;
158
165 virtual Port *getPort(CONST char *name) CLASSIC_CCA_PURE;
167 virtual Port *getPort(const std::string & name) CLASSIC_CCA_PURE;
168
173 virtual void releasePort(CONST char *name) CLASSIC_CCA_PURE;
175 virtual void releasePort(const std::string & name) CLASSIC_CCA_PURE;
176
183 virtual int registerUsesPort(PortInfo *name_and_type) CLASSIC_CCA_PURE;
184
188 virtual int registerUsesPort( const std::string & portName, const std::string & portType) CLASSIC_CCA_PURE;
189
196 virtual int unregisterUsesPort(CONST char *name) CLASSIC_CCA_PURE;
199 virtual int unregisterUsesPort(const std::string & name) CLASSIC_CCA_PURE;
200
207 virtual int addProvidesPort(Port *inPort, PortInfo *name) CLASSIC_CCA_PURE;
208
212 virtual int addProvidesPort(Port *inPort, const std::string & portName, const std::string & portType) CLASSIC_CCA_PURE;
213
216 virtual void removeProvidesPort(CONST char *name) CLASSIC_CCA_PURE;
217
220 virtual void removeProvidesPort(const std::string & name) CLASSIC_CCA_PURE;
221
226 virtual CDELETE ComponentID* getComponentID() CLASSIC_CCA_PURE;
227
228 };
229
230//===================================================================
234 class Component {
235 public:
237 virtual ~Component(){}
238
241 virtual void setServices(Services *cc) CLASSIC_CCA_PURE;
242 };
243
244//===================================================================
245
246} CCA_NAMESPACE_ENDSEMICOLON // end namespace cca
247} CCA_NAMESPACE_ENDSEMICOLON // end namespace gov
248} CCA_NAMESPACE_ENDSEMICOLON // end namespace classic
249
250#endif //__CCA_H_
An opaque reference to a Component.
Definition cca.h:122
virtual ~ComponentID()
obligatory virtual destructor
Definition cca.h:125
virtual CFREE char * toString() CLASSIC_CCA_PURE
Produce a string that, within the current framework, that uniquely defines this component reference.
Component object model that all Components must implement.
Definition cca.h:234
virtual void setServices(Services *cc) CLASSIC_CCA_PURE
The components containing framework provides services through the Services interface.
virtual ~Component()
obligatory virtual destructor
Definition cca.h:237
An interface (deprecated) that describes a Port.
Definition cca.h:100
virtual CONST char * getProperty(char *name) CLASSIC_CCA_PURE
Returns the string value for this property, or 0 if it is undefined.
virtual CONST char * getName() CONST CLASSIC_CCA_PURE
Returns the instance name for this Port.
virtual CONST char * getType() CONST CLASSIC_CCA_PURE
Returns the type for this Port.
virtual ~PortInfo()
obligatory virtual destructor
Definition cca.h:103
A tag interface to identify an interface capable of being exported to or imported from a CCA componen...
Definition cca.h:92
virtual ~Port()
obligatory virtual destructor
Definition cca.h:95
The handle through which the component communicates with its containing framework.
Definition cca.h:142
virtual void removeProvidesPort(CONST char *name) CLASSIC_CCA_PURE
Notifies the framework that a previously exported Port is no longer available for use.
virtual void removeProvidesPort(const std::string &name) CLASSIC_CCA_PURE
always returns 0.
virtual void releasePort(const std::string &name) CLASSIC_CCA_PURE
stl version of releaseport
virtual Port * getPort(CONST char *name) CLASSIC_CCA_PURE
Fetch a port from the framework.
virtual Port * getPort(const std::string &name) CLASSIC_CCA_PURE
stl version of getport
virtual int addProvidesPort(Port *inPort, const std::string &portName, const std::string &portType) CLASSIC_CCA_PURE
always returns 0.
virtual int unregisterUsesPort(const std::string &name) CLASSIC_CCA_PURE
always returns 0.
virtual ~Services()
obligatory virtual destructor
Definition cca.h:145
virtual int registerUsesPort(const std::string &portName, const std::string &portType) CLASSIC_CCA_PURE
always returns 0.
virtual int registerUsesPort(PortInfo *name_and_type) CLASSIC_CCA_PURE
Notifies the framework that a port described by PortInfo may be used by this component.
virtual int unregisterUsesPort(CONST char *name) CLASSIC_CCA_PURE
Notify the framework that a Port, previously registered by this component, is no longer desired.
virtual void releasePort(CONST char *name) CLASSIC_CCA_PURE
Free's the port indicated by the instance name for modification by the component's containing framewo...
virtual CDELETE ComponentID * getComponentID() CLASSIC_CCA_PURE
Get a reference to the component which this Services object belongs.
virtual PortInfo * createPortInfo(CONST char *name, CONST char *type, CONST char **properties) CLASSIC_CCA_PURE
Creates a PortInfo to be used in subsequent calls to describe a Port.
virtual int addProvidesPort(Port *inPort, PortInfo *name) CLASSIC_CCA_PURE
Exports a Port implemented by this component to the framework.
UNADOPTED: A class to support the runtime introspection of the CCA version.
Definition cca.h:64
static CONST int Major()
@ Revision numbering scheme will be rigorously followed after 1_0_0.
static CONST char * name()
The descriptive source release string.
static CONST int Minor()
Minor revision; increments with binary incompatible changes in well known ports, including changes in...
static CONST char * id()
The dot notation release number string; major.minor.patch.
static CONST int Patch()
Patch revision; binary compatible changes, such as addition of new common port definitions.
To deal with babel taking over this same namespace we name this one "classic.
Definition SimpleStamper.h:7