pkgname-service.cpp
Go to the documentation of this file.
00001 #include <rtt/RTT.hpp>
00002 #include <rtt/plugin/ServicePlugin.hpp>
00003 
00004 using namespace RTT;
00005 using namespace std;
00006 
00010 class MyService : public RTT::Service {
00011 public:
00012     MyService(TaskContext* owner) 
00013         : Service("myservice", owner) 
00014     {
00015         this->addOperation("getOwnerName", &MyService::getOwnerName, this).doc("Returns the name of the owner of this object.");
00016     }
00017 
00018     string getOwnerName() {
00019         // getOwner() returns the TaskContext pointer we got in
00020         // the constructor:
00021         return getOwner()->getName();
00022     }
00023 };
00024 
00025 /* For consistency reasons, it's better to name the
00026  * service the same as in the class above.
00027  */
00028 ORO_SERVICE_NAMED_PLUGIN(MyService, "myservice")


ocl
Author(s): OCL Development Team
autogenerated on Mon Oct 6 2014 03:16:37