pkgname-service.cpp
Go to the documentation of this file.
1 #include <rtt/RTT.hpp>
3 
4 using namespace RTT;
5 using namespace std;
6 
10 class MyService : public RTT::Service {
11 public:
13  : Service("myservice", owner)
14  {
15  this->addOperation("getOwnerName", &MyService::getOwnerName, this).doc("Returns the name of the owner of this object.");
16  }
17 
18  string getOwnerName() {
19  // getOwner() returns the TaskContext pointer we got in
20  // the constructor:
21  return getOwner()->getName();
22  }
23 };
24 
25 /* For consistency reasons, it's better to name the
26  * service the same as in the class above.
27  */
#define ORO_SERVICE_NAMED_PLUGIN(SERVICE, NAME)
string getOwnerName()
const std::string & doc() const
MyService(TaskContext *owner)


ocl
Author(s): OCL Development Team
autogenerated on Mon Mar 23 2020 04:47:19