17 #include <boost/program_options.hpp> 24 namespace po = boost::program_options;
29 po::variables_map
vm_;
37 po::options_description desc(
"Allowed options");
38 desc.add_options()(
"help",
"produce help message")(
39 "input-file", po::value<string>(),
"library to load");
41 po::store(po::parse_command_line(argc, argv, desc), vm_);
44 if (vm_.count(
"help")) {
48 if (!vm_.count(
"input-file")) {
49 cout <<
"No filename specified\n";
52 dynamicLibraryName_ = vm_[
"input-file"].as<
string>();
60 void *SotRobotControllerLibrary =
61 dlopen(
"libpluginabstract.so", RTLD_LAZY | RTLD_LOCAL);
62 if (!SotRobotControllerLibrary) {
63 std::cerr <<
"Cannot load library: " << dlerror() <<
'\n';
72 (
createPlugin_t *)dlsym(SotRobotControllerLibrary,
"createPlugin");
73 const char *dlsym_error = dlerror();
75 std::cerr <<
"Cannot load symbol create: " << dlsym_error <<
'\n';
83 cout <<
"Went out from Initialization." << endl;
87 int main(
int argc,
char *argv[]) {
std::string dynamicLibraryName_
virtual void Initialization(std::string &astr)=0
PluginAbstract * sotController_
int parseOptions(int argc, char *argv[])
PluginAbstract * createPlugin()
PluginAbstract * createPlugin_t()
int main(int argc, char *argv[])