23#ifndef YARP_NO_DEPRECATED
31#ifndef YARP_NO_DEPRECATED
39 const std::string& dll_name,
40 const std::string& fn_name)
42 return subopen(factory, dll_name, fn_name);
46 const std::string& dll_name,
47 const std::string& fn_name)
50 "Trying plugin [dll: %s] [fn: %s]",
53 bool ok = factory.
open(dll_name.c_str(), fn_name.c_str());
55 "Trying to find library '%s' containing function '%s' -- %s",
57 fn_name.c_str(), ok ?
"found" :
"fail");
60 "Found plugin [dll: %s] [fn: %s]",
63 this->dll_name = dll_name;
64 this->fn_name = fn_name;
68 "Error while opening %s:\n %s",
73 "Error while opening %s:\n %s",
84 "Plugin [name: %s] [dll: %s] [fn: %s]",
88 if (selector !=
nullptr && !name.empty()) {
92 for (
size_t i = 0;
i < paths.
size();
i++) {
95 if (options.
check(
"path")) {
99 }
else if (options.
check(
"relative_path")) {
107 std::string ext = options.
find(
"extension").asString();
108 std::string
basename = (dll_name.find(
'.') != std::string::npos) ? name : dll_name;
109 std::string fn = (fn_name.empty()) ? name : fn_name;
113#if defined(_MSC_VER) && !defined(NDEBUG)
122 if (subopen(factory,
fullpath, fn)) {
126#if defined(_MSC_VER) && defined(NDEBUG)
138# if defined(_MSC_VER) && !defined(NDEBUG)
150# if defined(_MSC_VER) && defined(NDEBUG)
160 if (!dll_name.empty() || !fn_name.empty()) {
161 return open(factory, dll_name, fn_name);
163 return factory.
open((std::string(
"yarp_") + name).
c_str(),
164 (fn_name.empty()) ? name.c_str() : fn_name.c_str());
203bool YarpPluginSettings::readFromSelector(
const std::string& name)
212 "Cannot find \"%s\" plugin (not built in, and no .ini file found for it)"
213 "Check that YARP_DATA_DIRS leads to at least one directory with plugins/%s.ini "
214 "or share/yarp/plugins/%s.ini in it",
226 std::lock_guard<std::mutex>
guard(mutex);
230 if (config.
check(
"last_update_time")) {
271 for (
size_t i = 0;
i <
inilst.size();
i++) {
277 for (
size_t i = 0;
i < lst.
size();
i++) {
289 lst =
inigroup.findGroup(
"search").tail();
290 for (
size_t i = 0;
i < lst.
size();
i++) {
A simple collection of objects that can be described and transmitted in a portable way.
void add(const Value &value)
Add a Value to the bottle, at the end of the list.
Bottle & addList()
Places an empty nested list in the bottle, at the end of the list.
size_type size() const
Gets the number of elements in the bottle.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
Bottle & findGroup(const std::string &key) const override
Gets a list corresponding to a given keyword.
Bottle tail() const
Get all but the first element of a bottle.
void clear()
Empties the bottle of any objects it contains.
bool isNull() const override
Checks if the object is invalid.
A mini-server for performing network communication in the background.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
bool fromConfigDir(const std::string &dirname, const std::string §ion=std::string(), bool wipe=true)
Interprets all files in a directory as lists of properties as described in fromConfigFile().
void clear()
Remove all associations.
Bottle & findGroup(const std::string &key) const override
Gets a list corresponding to a given keyword.
Helper class for finding config files and other external resources.
bool configure(int argc, char *argv[], bool skipFirstArgument=true)
Sets up the ResourceFinder.
bool isConfigured() const
static ResourceFinder & getResourceFinderSingleton()
Access a ResourceFinder singleton whose lifetime will match that of the YARP library.
yarp::os::Bottle findPaths(const std::string &name)
Expand a partial path to a list of paths.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
A wrapper for a named factory method in a named shared library.
@ STATUS_FACTORY_NOT_FUNCTIONAL
Named method is not working right.
@ STATUS_FACTORY_NOT_FOUND
Named method wasn't present in library.
@ STATUS_LIBRARY_NOT_LOADED
Named shared library failed to load.
@ STATUS_LIBRARY_NOT_FOUND
Named shared library was not found.
bool open(const char *dll_name, const char *fn_name=nullptr)
Configure the factory.
int getStatus() const
Get the status of the factory.
std::string getError() const
Get the latest error of the factory.
static double nowSystem()
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
static Value * makeValue(const std::string &txt)
Create a Value from a text description.
virtual std::string asString() const
Get string value.
Bottle getSearchPath() const
Bottle getSelectedPlugins() const
void scan()
Find plugin configuration files, and run [plugin] sections through the select method.
virtual bool select(Searchable &options)
Determine whether a plugin is of interest.
bool open(SharedLibraryFactory &factory)
Initialize a factory object based on the hints available.
bool readFromSearchable(Searchable &options, const std::string &name)
Configure settings from a configuration file or other searchable object.
void reportStatus(SharedLibraryFactory &factory) const
Give a human-readable report of the status of a factory.
void setVerboseMode(bool verbose)
Should messages be printed showing what searches YARP is trying out?
void reportFailure() const
Give a human-readable failure-to-load report, summarizing the active hints.
#define yCError(component,...)
#define yCWarning(component,...)
#define yCDebug(component,...)
#define YARP_OS_LOG_COMPONENT(name, name_string)
#define YARP_OS_NON_CONST_LOG_COMPONENT(name, name_string)
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.