'Classic' CCA c++ binding (ccaffeine-only)
0.5.7
|
00001 #ifndef __CCA_H__ 00002 #define __CCA_H__ 00003 00004 #include <string> 00005 00014 #define CONST 00015 00019 #define ENDSEMI // use of this macro is deprecated 00020 #define CCA_NAMESPACE_ENDSEMICOLON 00021 00027 #define CFREE 00028 #define CDELETE 00029 00033 #ifdef NO_PURE_VIRTUAL 00034 #define CLASSIC_CCA_PURE 00035 #else 00036 #define CLASSIC_CCA_PURE = 0 00037 #endif // NO_PURE_VIRTUAL 00038 00053 namespace classic { 00054 00055 namespace gov { 00059 namespace cca { 00060 00064 class Version { 00065 public: 00067 static CONST char *name(); 00069 static CONST char *id(); 00075 static CONST int Major(); 00080 static CONST int Minor(); 00083 static CONST int Patch(); 00085 }; 00086 00087 00088 //=================================================================== 00089 00092 class Port { 00093 public: 00095 virtual ~Port (){} 00096 }; 00097 00098 //=================================================================== 00100 class PortInfo { 00101 public: 00103 virtual ~PortInfo(){} 00104 00107 virtual CONST char* getType() CONST CLASSIC_CCA_PURE; 00108 00112 virtual CONST char* getName() CONST CLASSIC_CCA_PURE; 00113 00116 virtual CONST char* getProperty(char* name) CLASSIC_CCA_PURE; 00117 00118 }; 00119 00120 //=================================================================== 00122 class ComponentID { 00123 public: 00125 virtual ~ComponentID() {} 00126 00132 virtual CFREE char* toString() CLASSIC_CCA_PURE; 00133 00134 00135 }; 00136 00137 //=================================================================== 00142 class Services { 00143 public: 00145 virtual ~Services (){} 00146 00157 virtual PortInfo * createPortInfo(CONST char *name, CONST char *type, CONST char** properties) CLASSIC_CCA_PURE; 00158 00165 virtual Port *getPort(CONST char *name) CLASSIC_CCA_PURE; 00167 virtual Port *getPort(const std::string & name) CLASSIC_CCA_PURE; 00168 00173 virtual void releasePort(CONST char *name) CLASSIC_CCA_PURE; 00175 virtual void releasePort(const std::string & name) CLASSIC_CCA_PURE; 00176 00183 virtual int registerUsesPort(PortInfo *name_and_type) CLASSIC_CCA_PURE; 00184 00188 virtual int registerUsesPort( const std::string & portName, const std::string & portType) CLASSIC_CCA_PURE; 00189 00196 virtual int unregisterUsesPort(CONST char *name) CLASSIC_CCA_PURE; 00199 virtual int unregisterUsesPort(const std::string & name) CLASSIC_CCA_PURE; 00200 00207 virtual int addProvidesPort(Port *inPort, PortInfo *name) CLASSIC_CCA_PURE; 00208 00212 virtual int addProvidesPort(Port *inPort, const std::string & portName, const std::string & portType) CLASSIC_CCA_PURE; 00213 00216 virtual void removeProvidesPort(CONST char *name) CLASSIC_CCA_PURE; 00217 00220 virtual void removeProvidesPort(const std::string & name) CLASSIC_CCA_PURE; 00221 00226 virtual CDELETE ComponentID* getComponentID() CLASSIC_CCA_PURE; 00227 00228 }; 00229 00230 //=================================================================== 00234 class Component { 00235 public: 00237 virtual ~Component(){} 00238 00241 virtual void setServices(Services *cc) CLASSIC_CCA_PURE; 00242 }; 00243 00244 //=================================================================== 00245 00246 } CCA_NAMESPACE_ENDSEMICOLON // end namespace cca 00247 } CCA_NAMESPACE_ENDSEMICOLON // end namespace gov 00248 } CCA_NAMESPACE_ENDSEMICOLON // end namespace classic 00249 00250 #endif //__CCA_H_