108
108
module_registry_[add_str]= handle;
110
VertexDesc handle_vertex;
110
111
Vertex vertex_info(add_str, handle);
112
VertexDesc handle_vertex= boost::add_vertex(depend_graph_);
113
/* It's possible we could have added a vertex without a module attached
114
as part of adding dependency edges */
115
bool found_vertex= false;
116
vertex_iter vertexes= boost::vertices(depend_graph_).first;
117
while (vertexes != vertices(depend_graph_).second)
119
if (properties(*vertexes).getName() == add_str)
128
handle_vertex= *vertexes;
132
handle_vertex= boost::add_vertex(depend_graph_);
113
134
properties(handle_vertex)= vertex_info;
137
Module::Depends::const_iterator handle_deps= handle->getDepends().begin();
138
while (handle_deps != handle->getDepends().end())
140
std::string dep_str((*handle_deps));
141
transform(dep_str.begin(), dep_str.end(),
142
dep_str.begin(), ::tolower);
144
bool found_dep= false;
145
vertex_iter it= boost::vertices(depend_graph_).first;
146
while (it != vertices(depend_graph_).second)
148
if (properties(*it).getName() == dep_str)
151
add_edge(handle_vertex, *it, depend_graph_);
158
Vertex dep_vertex_info(dep_str);
159
VertexDesc dep_vertex= boost::add_vertex(depend_graph_);
160
properties(dep_vertex)= dep_vertex_info;
116
168
void module::Registry::remove(module::Module *handle)
133
185
assert(arg.size() == plugin_registry.size());
136
vector<module::Module *> module::Registry::getList(bool active)
188
module::Registry::ModuleList module::Registry::getList()
138
module::Module *plugin= NULL;
140
190
std::vector<module::Module *> plugins;
141
plugins.reserve(module_registry_.size());
143
ModuleMap::iterator map_iter;
144
for (map_iter= module_registry_.begin();
145
map_iter != module_registry_.end();
192
std::cout << "In module::Registry::getList" << std::endl;
194
VertexList vertex_list;
196
boost::topological_sort(depend_graph_, std::back_inserter(vertex_list));
198
std::cout << "plugin load ordering: ";
199
for (VertexList::iterator i = vertex_list.begin();
200
i != vertex_list.end(); ++i)
148
plugin= (*map_iter).second;
150
plugins.push_back(plugin);
151
else if (plugin->isInited)
152
plugins.push_back(plugin);
202
std::cout << properties(*i).getName() << " ";
203
if (properties(*i).getModule() != NULL)
205
plugins.push_back(properties(*i).getModule());
208
std::cout << std::endl;