Orocos Real-Time Toolkit  2.9.0
Namespaces | Macros
ServicePlugin.hpp File Reference
#include "Plugin.hpp"
#include <string>
#include "../TaskContext.hpp"
#include "../internal/GlobalService.hpp"

Go to the source code of this file.

Namespaces

 RTT
 Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
 
 RTT::plugin
 Classes and functions for creating and loading plugins.
 

Macros

#define ORO_SERVICEPLUGIN_xstr(s)   ORO_SERVICEPLUGIN_str(s)
 
#define ORO_SERVICEPLUGIN_str(s)   #s
 
#define ORO_SERVICE_NAMED_PLUGIN(SERVICE, NAME)
 You can use this macro to make any Service available as a plugin. More...
 
#define ORO_SERVICE_PLUGIN(SERVICE)
 You can use this macro to make any Service available as a plugin. More...
 
#define ORO_GLOBAL_SERVICE_NAMED_PLUGIN(SERVICE, NAME)
 You can use this macro to make any Service available as a global service. More...
 
#define ORO_GLOBAL_SERVICE_PLUGIN(SERVICE)
 You can use this macro to make any Service available as a global service. More...
 

Macro Definition Documentation

#define ORO_GLOBAL_SERVICE_NAMED_PLUGIN (   SERVICE,
  NAME 
)
Value:
extern "C" {\
if (tc != 0) return false; \
RTT::Service::shared_ptr sp( new SERVICE( tc ) ); \
return RTT::internal::GlobalService::Instance()->addService( sp ); \
} \
RTT_EXPORT RTT::Service::shared_ptr createService(); \
RTT::Service::shared_ptr createService() { \
RTT::Service::shared_ptr sp( new SERVICE( 0 ) ); \
return sp; \
} \
RTT_EXPORT std::string getRTTPluginName(); \
std::string getRTTPluginName() { \
return NAME; \
} \
RTT_EXPORT std::string getRTTTargetName(); \
std::string getRTTTargetName() { \
} \
}
#define RTT_EXPORT
Definition: rtt-config.h:98
#define OROCOS_TARGET_NAME
RTT_EXPORT std::string getRTTPluginName()
Return the unique name of this plugin.
boost::shared_ptr< Service > shared_ptr
Definition: Service.hpp:101
RTT_EXPORT bool loadRTTPlugin(RTT::TaskContext *t)
Instructs this plugin to load itself into the process or a component.
The TaskContext is the C++ representation of an Orocos component.
Definition: TaskContext.hpp:93
RTT_EXPORT std::string getRTTTargetName()
Returns the target name for which this plugin was built.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:52

You can use this macro to make any Service available as a global service.

The service cannot be loaded into a TaskContext.

Parameters
SERVICEA class that inherits from Service and takes a TaskContext* as argument in a constructor.
NAMEA string being the name of the plugin.
Note
Do not use this macro inside a namespace !

Definition at line 138 of file ServicePlugin.hpp.

#define ORO_GLOBAL_SERVICE_PLUGIN (   SERVICE)
Value:
extern "C" { \
if (tc != 0) return false; \
RTT::Service::shared_ptr sp( new SERVICE( tc ) ); \
return RTT::internal::GlobalService::Instance()->addService( sp ); \
} \
RTT_EXPORT RTT::Service::shared_ptr createService(); \
RTT::Service::shared_ptr createService() { \
RTT::Service::shared_ptr sp( new SERVICE( 0 ) ); \
return sp; \
} \
RTT_EXPORT std::string getRTTPluginName(); \
std::string getRTTPluginName() { \
return ORO_SERVICEPLUGIN_xstr(SERVICE); \
} \
RTT_EXPORT std::string getRTTTargetName(); \
std::string getRTTTargetName() { \
} \
}
#define RTT_EXPORT
Definition: rtt-config.h:98
#define OROCOS_TARGET_NAME
#define ORO_SERVICEPLUGIN_xstr(s)
RTT_EXPORT std::string getRTTPluginName()
Return the unique name of this plugin.
boost::shared_ptr< Service > shared_ptr
Definition: Service.hpp:101
RTT_EXPORT bool loadRTTPlugin(RTT::TaskContext *t)
Instructs this plugin to load itself into the process or a component.
The TaskContext is the C++ representation of an Orocos component.
Definition: TaskContext.hpp:93
RTT_EXPORT std::string getRTTTargetName()
Returns the target name for which this plugin was built.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:52

You can use this macro to make any Service available as a global service.

The service cannot be loaded into a TaskContext.

Parameters
SERVICEA class that inherits from Service and takes a TaskContext* as argument in a constructor. The name of the plugin is equal to SERVICE, but the name of the service (ie Service::getName() ) may be different.
Note
Do not use this macro inside a namespace !

Definition at line 170 of file ServicePlugin.hpp.

#define ORO_SERVICE_NAMED_PLUGIN (   SERVICE,
  NAME 
)
Value:
extern "C" {\
if (tc == 0) return true; \
RTT::Service::shared_ptr sp( new SERVICE( tc ) ); \
return tc->provides()->addService( sp ); \
} \
RTT_EXPORT RTT::Service::shared_ptr createService(); \
RTT::Service::shared_ptr createService() { \
RTT::Service::shared_ptr sp( new SERVICE( 0 ) ); \
return sp; \
} \
RTT_EXPORT std::string getRTTPluginName(); \
std::string getRTTPluginName() { \
return NAME; \
} \
RTT_EXPORT std::string getRTTTargetName(); \
std::string getRTTTargetName() { \
} \
}
#define RTT_EXPORT
Definition: rtt-config.h:98
#define OROCOS_TARGET_NAME
RTT_EXPORT std::string getRTTPluginName()
Return the unique name of this plugin.
boost::shared_ptr< Service > shared_ptr
Definition: Service.hpp:101
RTT_EXPORT bool loadRTTPlugin(RTT::TaskContext *t)
Instructs this plugin to load itself into the process or a component.
The TaskContext is the C++ representation of an Orocos component.
Definition: TaskContext.hpp:93
RTT_EXPORT std::string getRTTTargetName()
Returns the target name for which this plugin was built.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:52

You can use this macro to make any Service available as a plugin.

Parameters
SERVICEA class that inherits from Service and takes a TaskContext* as argument in a constructor.
NAMEA string being the name of the plugin.
Note
Do not use this macro inside a namespace ! For example: ORO_SERVICE_NAMED_PLUGIN ( KDL::KDLService, "kdl" ) where KDL::KDLService is a class name.

Definition at line 72 of file ServicePlugin.hpp.

#define ORO_SERVICE_PLUGIN (   SERVICE)
Value:
extern "C" { \
if (tc == 0) return true; \
RTT::Service::shared_ptr sp( new SERVICE( tc ) ); \
return tc->provides()->addService( sp ); \
} \
RTT_EXPORT RTT::Service::shared_ptr createService(); \
RTT::Service::shared_ptr createService() { \
RTT::Service::shared_ptr sp( new SERVICE( 0 ) ); \
return sp; \
} \
RTT_EXPORT std::string getRTTPluginName(); \
std::string getRTTPluginName() { \
return ORO_SERVICEPLUGIN_xstr(SERVICE); \
} \
RTT_EXPORT std::string getRTTTargetName(); \
std::string getRTTTargetName() { \
} \
}
#define RTT_EXPORT
Definition: rtt-config.h:98
#define OROCOS_TARGET_NAME
#define ORO_SERVICEPLUGIN_xstr(s)
RTT_EXPORT std::string getRTTPluginName()
Return the unique name of this plugin.
boost::shared_ptr< Service > shared_ptr
Definition: Service.hpp:101
RTT_EXPORT bool loadRTTPlugin(RTT::TaskContext *t)
Instructs this plugin to load itself into the process or a component.
The TaskContext is the C++ representation of an Orocos component.
Definition: TaskContext.hpp:93
RTT_EXPORT std::string getRTTTargetName()
Returns the target name for which this plugin was built.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:52

You can use this macro to make any Service available as a plugin.

Parameters
SERVICEA class that inherits from Service and takes a TaskContext* as argument in a constructor. The name of the plugin is equal to SERVICE, but the name of the service (ie Service::getName() ) may be different.
Note
Do not use this macro inside a namespace ! For example: ORO_SERVICE_PLUGIN ( KDL::KDLService ) where KDL::KDLService is a class name.

Definition at line 106 of file ServicePlugin.hpp.

#define ORO_SERVICEPLUGIN_str (   s)    #s

Definition at line 54 of file ServicePlugin.hpp.

#define ORO_SERVICEPLUGIN_xstr (   s)    ORO_SERVICEPLUGIN_str(s)

Definition at line 53 of file ServicePlugin.hpp.