00001 #ifndef _CAPABILITY_H 00002 #define _CAPABILITY_H 00003 00023 #include <Geometry.H> 00024 #include <WeightedPoints.H> 00025 #include <RobotTypes.H> 00026 #include <Time.H> 00027 #include <string> 00028 #include <COMObject.H> 00029 00030 00041 //$Id: Capability.H 66 2007-01-23 20:53:23Z fwph $ 00047 namespace WURDE { 00048 class CommsManager; 00052 class Capability{ 00053 public: 00054 00059 virtual void runUpdate() = 0; 00060 00065 virtual void setManager(CommsManager *myManager) = 0; 00066 00070 virtual void disconnect() = 0; 00071 00075 virtual void activateSupplier()=0; 00076 00080 virtual void activateConsumer()=0; 00081 00087 virtual std::string getInterfaceName()=0; 00088 00092 virtual void setStreamName(const std::string & streamname)=0; 00093 00097 virtual void setGlobalName(const std::string & name)=0; 00098 00102 virtual bool newData() = 0; 00103 00107 virtual bool newInfo() = 0; 00108 00112 virtual void publishData() = 0; 00113 00117 virtual void publishInfo() = 0; 00118 00122 // virtual int getID() = 0; 00123 00124 virtual void setCOMObject(COMBase *object) = 0; 00125 00129 bool newRequest(){return newInfo();}; 00130 00134 void publishRequest(){publishInfo();}; 00135 00140 bool hasStream(){return m_haveStream;}; 00141 00145 std::string getStreamName(){return m_streamname;}; 00146 00150 std::string getGlobalName(){return m_globalname;}; 00151 00155 ConnectionStrategy getConnectionStrategy(){return m_strategy;}; 00156 00160 bool getAutoTimestamp(){return m_doTimestamp;}; 00161 00166 void setAutoTimestamp(bool val){m_doTimestamp=val;}; 00167 00172 bool getAutoTag(){return m_doTag;}; 00173 00178 void setAutoTag(bool val){m_doTag=val;}; 00179 00183 bool isSupplier(){return m_supplier;}; 00184 00188 StatusMode getRequestStatus(){return m_streamRequest;}; 00189 00193 void setRequestStatus(StatusMode val){m_streamRequest=val;}; 00194 00198 std::string getSourceModuleName(){return m_sourceModule;}; 00199 00203 void setSourceModuleName(std::string name){m_sourceModule=name;}; 00204 00213 virtual void setAutoPing(const bool &val) = 0; 00214 00220 virtual void doPing() = 0; 00221 00222 protected: 00226 Capability(){}; 00227 ConnectionStrategy m_strategy; 00228 00229 CommsManager *myManager; 00230 00231 /* name of the module providing our stream. */ 00232 std::string m_sourceModule; // this should probably eventually be removed, in 00233 // favor of a hash table in CommsManager 00234 00235 /* supplier status */ 00236 bool m_supplier; 00237 00238 /* stream/name stuff */ 00239 bool m_haveStream; 00240 bool m_haveGlobalname; 00241 StatusMode m_streamRequest; 00242 00243 /* info/data state */ 00244 bool m_doPublishData; 00245 bool m_doPublishInfo; 00246 bool m_doAutoPing; 00247 00248 /* config info */ 00249 bool m_doTimestamp; 00250 bool m_doTag; 00251 std::string m_streamname; 00252 std::string m_globalname; 00253 00254 private: 00255 //define copy constructor! assignment operator! 00256 00257 }; 00258 00259 00260 }; 00261 00262 00263 #endif