23 #include <coil/Properties.h> 24 #include <coil/File.h> 29 int main(
int argc,
char* argv[])
33 std::cerr <<
"usage: " << std::endl;
34 std::cerr << argv[0] <<
" .so or .DLL" << std::endl;
35 std::cerr << std::endl;
43 std::string fullname(argv[1]);
52 opts.push_back(
"dummy");
54 std::string load_path(
"manager.modules.load_path:");
56 opts.push_back(load_path);
58 opts.push_back(
"logger.enable:NO");
60 opts.push_back(
"manager.corba_servant:NO");
68 std::vector<coil::Properties> oldp(mgr.getFactoryProfiles());
69 mgr.load(basename.c_str(),
"");
70 std::vector<coil::Properties> newp(mgr.getFactoryProfiles());
71 std::vector<coil::Properties> profs;
73 for (
size_t i(0); i < newp.size(); ++i)
76 for (
size_t j(0);
j < oldp.size(); ++
j)
78 if (oldp[
j][
"implementation_id"] == newp[i][
"implementation_id"] &&
79 oldp[
j][
"type_name"] == newp[i][
"type_name"] &&
80 oldp[
j][
"description"] == newp[i][
"description"] &&
81 oldp[
j][
"version"] == newp[i][
"version"])
86 if (!exists) { profs.push_back(newp[i]); }
90 if (profs.size() == 0)
92 std::cerr <<
"Load failed." << std::endl;
98 std::cerr <<
"One ore more modules loaded." << std::endl;
104 for (
size_t i(0); i < keys.size(); ++i)
106 std::cout << keys[i] <<
": " << profs[0][keys[i]] << std::endl;
int main(int argc, char *argv[])
static Manager & instance()
Get instance of the manager.
RTComponent manager class.
std::vector< std::string > vstring
def j(str, encoding="cp932")
static Manager * init(int argc, char **argv)
Initialize manager.
char ** toArgv(const vstring &args)
Convert the given string list into the argument list.
const char * basename(const char *path)
Get a file name part than a file pass.
const char * dirname(const char *path)