|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
24 return options.
check(
"type",
Value(
"none")).asString() ==
"RFModule";
53 RFPlugin::RFPlugin() :
65 return mPriv->command;
70 return mPriv->module->getThreadKey();
75 mPriv->module->stopModule();
80 return !mPriv->module->isStopping();
93 char* p2 = strtok(str,
" ");
94 while ((p2 !=
nullptr) && argc < kMaxArgs - 1) {
96 p2 = strtok(
nullptr,
" ");
99 return make_pair(argc, argv);
105 string name = inCommand.substr(0, inCommand.find(
' '));
107 char* str =
new char[inCommand.size() + 1];
108 memcpy(str, inCommand.c_str(), inCommand.size());
109 str[inCommand.size()] =
'\0';
111 mPriv->command = inCommand;
118 if (staticmodule !=
nullptr) {
120 if (!staticmodule->configure(rf)) {
124 mPriv->module = staticmodule;
138 if (!settings.
setSelector(mPriv->shared->selector)) {
141 if (!mPriv->shared->yarpPlugin.open(settings)) {
145 mPriv->shared->sharedLibClass.open(*mPriv->shared->yarpPlugin.getFactory());
147 if (!mPriv->shared->sharedLibClass.isValid()) {
152 settings.
setClassInfo(mPriv->shared->yarpPlugin.getFactory()->getClassName(), mPriv->shared->yarpPlugin.getFactory()->getBaseClassName());
156 ret = mPriv->shared->sharedLibClass.getContent().configure(rf);
162 mPriv->shared->sharedLibClass->runModuleThreaded();
164 mPriv->module = &(mPriv->shared->sharedLibClass.getContent());
virtual void close()
closes the plugin
A base-class for standard YARP modules that supports ResourceFinder.
A base class for nested structures that can be searched.
Pick out a set of relevant plugins.
bool setSelector(YarpPluginSelector &selector)
Use a selector to find a plugin or plugins.
virtual int runModuleThreaded()
Calls updateModule() on a separate thread until that returns false.
bool configure(int argc, char *argv[], bool skipFirstArgument=true)
Sets up the ResourceFinder.
virtual std::string getCmd()
get the command line used to open the plugin
void setLibraryMethodName(const std::string &dll_name, const std::string &fn_name)
Set the name of the library to load and the method name to use as a factory.
void setPluginName(const std::string &name)
Set the name of the plugin to load.
virtual int getThreadKey()
get the thread id
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
SharedLibraryClass< RFModule > sharedLibClass
virtual bool open(const std::string &command)
opens the plugin
void setClassInfo(const std::string &class_name, const std::string &baseclass_name)
Set the information about the class and the base class constructed by this plugin.
void scan()
Find plugin configuration files, and run [plugin] sections through the select method.
Collect hints for finding a particular plugin.
std::pair< int, char ** > str2ArgcArgv(char *str)
virtual bool isRunning()
check if the plugin is running
std::string getMethodName() const
An interface to the operating system, including Port based communication.
YarpPlugin< RFModule > yarpPlugin
RFModule * GetModule(const std::string &name)
RFModuleSelector selector
A single value (typically within a Bottle).
static RFModuleFactory & GetInstance()
Helper class for finding config files and other external resources.