Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
scripts
pkg
templates
src
pkgname-service.cpp
Go to the documentation of this file.
1
#include <
rtt/RTT.hpp
>
2
#include <
rtt/plugin/ServicePlugin.hpp
>
3
4
using namespace
RTT
;
5
using namespace
std
;
6
10
class
MyService
:
public
RTT::Service
{
11
public
:
12
MyService
(
TaskContext
* owner)
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
*/
28
ORO_SERVICE_NAMED_PLUGIN
(
MyService
,
"myservice"
)
std
ORO_SERVICE_NAMED_PLUGIN
#define ORO_SERVICE_NAMED_PLUGIN(SERVICE, NAME)
ServicePlugin.hpp
RTT::Service
MyService::getOwnerName
string getOwnerName()
Definition:
pkgname-service.cpp:18
RTT::Service::doc
const std::string & doc() const
MyService
Definition:
pkgname-service.cpp:10
MyService::MyService
MyService(TaskContext *owner)
Definition:
pkgname-service.cpp:12
RTT::TaskContext
RTT
RTT.hpp
ocl
Author(s): OCL Development Team
autogenerated on Mon Mar 23 2020 04:47:19