diff -abBruN orocos-toolchain-2.2.0.orig/rtt/rtt/TaskContext.hpp orocos-toolchain-2.2.0.mod/rtt/rtt/TaskContext.hpp --- orocos-toolchain-2.2.0.orig/rtt/rtt/TaskContext.hpp 2010-12-08 22:45:32.000000000 +0100 +++ orocos-toolchain-2.2.0.mod/rtt/rtt/TaskContext.hpp 2011-01-26 09:29:22.138152106 +0100 @@ -365,13 +365,27 @@ } /** + * Ask if we can get a previously added operation for + * use in a C++ OperationCaller object. + * + * @param name The name of the operation to retrieve. + * + * @return true if it could be found, false otherwise. + */ + bool hasOperation(const std::string& name) + { + return (tcservice->getOperation(name) != 0); + } + + /** * Get a previously added operation for * use in a C++ OperationCaller object. Store the result of this * function in a OperationCaller<\a Signature> object. * * @param name The name of the operation to retrieve. * - * @return true if it could be found, false otherwise. + * @return the OperationCaller<\a Signature> object if it could + * be found, 0 otherwise. */ OperationInterfacePart* getOperation( std::string name ) { @@ -433,6 +447,21 @@ } /** + * Ask if the attribute exist. + * + * @param name The name of the attribute to search for. + * + * @return true if the attribute exists, false if not. + * + * @see addAttribute to add an Attribute. + * @see getAttribute to get an Attribute. + */ + bool hasAttribute(const std::string& name) const + { + return tcservice->hasAttribute(name); + } + + /** * Retrieve a Attribute by name. Returns zero if * no Attribute by that name exists. * @example @@ -482,6 +511,21 @@ } /** + * Ask if the property exist. + * + * @param name The name of the property to search for. + * + * @return true if the property exists, false if not. + * + * @see addProperty to add a Property. + * @see getProperty to get a Property. + */ + bool hasProperty(const std::string& name) const + { + return tcservice->hasProperty(name); + } + + /** * Get a Property with name \a name. * * @param name The name of the property to search for. @@ -554,6 +598,20 @@ } /** + * Ask if the port exist. + * + * @param name The port name. + * + * @return true if the port exists, false if not. + * + * @see addPort to add a Port. + * @see getPort to get a Port. + */ + bool hasPort(const std::string& name) const { + return (ports()->getPort(name) != 0); + } + + /** * Get a port of this Component. * @param name The port name * @return a pointer to a port or null if it does not exist.