22 #ifndef ROBOTTESTINGFRAMEWORK_DLLPLUGINLOADERIMPL_H 23 #define ROBOTTESTINGFRAMEWORK_DLLPLUGINLOADERIMPL_H 69 T*
open(
const std::string filename,
70 const std::string factory_name)
85 error =
"cannot load plugin " + filename +
"; (it is not a Robot Testing Framework " + plug_type +
" plugin!)";
136 const std::string factory_name)
139 std::string fullpath;
141 std::string ext =
".dll";
143 std::string ext =
".so";
145 std::string basename;
147 if (filename.find(ext) != std::string::npos) {
148 basename = filename.substr(0, filename.size() - ext.size());
155 #if defined(_MSC_VER) && !defined(NDEBUG) 158 fullpath = basename +
"d" + ext;
159 if (plugin->
factory.open(fullpath.c_str(), factory_name.c_str()))
165 fullpath = basename + ext;
166 if (plugin->
factory.open(fullpath.c_str(), factory_name.c_str()))
169 #if defined(_MSC_VER) && defined(NDEBUG) 172 fullpath = basename +
"d" + ext;
173 if (plugin->
factory.open(fullpath.c_str(), factory_name.c_str()))
183 # if defined(_MSC_VER) && !defined(NDEBUG) 186 fullpath = std::string(CMAKE_INTDIR) +
"/" + basename +
"d" + ext;
187 if (plugin->
factory.open(fullpath.c_str(), factory_name.c_str()))
193 fullpath = std::string(CMAKE_INTDIR) +
"/" + basename + ext;
194 if (plugin->
factory.open(fullpath.c_str(), factory_name.c_str()))
197 # if defined(_MSC_VER) && defined(NDEBUG) 200 fullpath = std::string(CMAKE_INTDIR) +
"/" + basename +
"d" + ext;
201 if (plugin->
factory.open(fullpath.c_str(), factory_name.c_str()))
210 #endif // ROBOTTESTINGFRAMEWORK_DLLPLUGINLOADERIMPL_H
void open_internal(const std::string filename, const std::string factory_name)
shlibpp::SharedLibraryClassFactory< T > factory
#define ROBOTTESTINGFRAMEWORK_PLUGIN_FACTORY_NAME
void close()
close Unloads the plugin and deletes any allocated memory.
T * open(const std::string filename, const std::string factory_name)
open Loads a generic plugin
constexpr int32_t VOCAB(char a, char b=0, char c=0, char d=0)
class DllPluginLoaderImpl
Container for an object created using a factory provided by a shared library.
shlibpp::SharedLibraryClass< T > test
virtual ~DllPluginLoaderImpl()
DllPluginLoaderImpl destructor.
A type-safe wrapper for SharedLibraryFactory, committing to creation/destruction of instances of a pa...
DllPluginLoaderImpl()
DllPluginLoaderImpl constructor.
const std::string & getLastError()
getLastError gets the last error if any.
static std::string decode(int code)