36 while (! initQueue_.empty()) {
37 initQueue_.front()->v_init();
38 initQueue_.pop_front();
45 struct senf::ppi::ModuleManager::RunGuard
47 RunGuard(
ModuleManager & m) : manager(m) { manager.running_ =
true; }
48 ~RunGuard() { manager.running_ =
false; }
57 RunGuard guard (*
this);
68 moduleRegistry_.push_back(&module);
75 moduleRegistry_.erase(
76 std::remove(moduleRegistry_.begin(), moduleRegistry_.end(), & module),
77 moduleRegistry_.end());
84 initQueue_.push_back(&i);
97 std::remove(initQueue_.begin(), initQueue_.end(), &i),
99 if (initQueue_.empty())
100 initRunner_.disable();
103 prefix_ senf::ppi::ModuleManager::ModuleManager()
108 console::sysdir().add(
"ppi", consoleDir_);
113 .doc(
"Dump complete PPI structure\n" 114 "The dump will contain one paragraph for each module. The first line gives module\n" 115 "information, additional lines list all connectors and their peers (if connected).\n" 117 "This information can be processed by 'tools/drawmodules.py' and 'dot' (from the\n" 118 "graphviz package) to generate a graphic representation of the module structure:\n" 120 " $ echo /sys/ppi/dump | nc -q1 <host> <port> \\\n" 121 " | python tools/drawmodules.py | dot -Tpng /dev/fd/0 >modules.png\n")
126 prefix_ senf::ppi::ModuleManager::~ModuleManager()
131 prefix_ void senf::ppi::ModuleManager::dumpModules(std::ostream & os)
134 for (ModuleRegistry::const_iterator i (moduleRegistry_.begin()), i_end (moduleRegistry_.end());
136 auto const & _tmp_to_make_clang_happy_ (**i);
137 os << *i <<
" " <<
prettyName(
typeid(_tmp_to_make_clang_happy_)) <<
"\n";
138 for (module::Module::ConnectorRegistry::iterator j ((*i)->connectorRegistry_.begin()),
139 j_end ((*i)->connectorRegistry_.end()); j != j_end; ++j) {
140 auto const & _tmp_to_make_clang_happy2_ (**j);
141 os <<
" " << *j <<
" " <<
prettyName(
typeid(_tmp_to_make_clang_happy2_));
142 if ((**j).connected()) {
143 os <<
" " << & (*j)->peer();
void run()
Called by senf::ppi::run()
Passive connector base-class.
boost::function< R(Args)> membind(R(T::*fn)(Args), T *ob)
ModuleManager public header.
std::string prettyName(std::type_info const &type)
bool throttled() const
Get accumulative throttling state.
static Priority const PRE
void init()
Called by senf::ppi::init()
Internal: Module management.