X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPPI%2FModuleManager.cc;h=65e686ec55e605549efd2ce7ac0922e43c24b8d6;hb=3aced0177a1c69c7af338b4e66db8694a71873ae;hp=66190d45368becc1d35e4097a6489962f2cfd61a;hpb=f13780e9e4da7df981d6f6542fbdc714beb34765;p=senf.git diff --git a/senf/PPI/ModuleManager.cc b/senf/PPI/ModuleManager.cc index 66190d4..65e686e 100644 --- a/senf/PPI/ModuleManager.cc +++ b/senf/PPI/ModuleManager.cc @@ -27,16 +27,16 @@ //#include "ModuleManager.ih" // Custom includes -#include #include +#include +#include #include "Module.hh" -#include //#include "ModuleManager.mpp" #define prefix_ -///////////////////////////////cc.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::ppi::ModuleManager prefix_ void senf::ppi::ModuleManager::init() @@ -66,32 +66,33 @@ prefix_ void senf::ppi::ModuleManager::run() scheduler::process(); } -//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// // private members prefix_ senf::ppi::ModuleManager::ModuleManager() - : running_(false), terminate_(false), + : running_(false), terminate_(false), initRunner_ ("senf::ppi::init", membind(&ModuleManager::init, this), scheduler::EventHook::PRE, false) { - senf::console::sysdir().add("ppi", consoleDir_); + console::sysdir().add("ppi", consoleDir_); consoleDir_ - .add("dump", senf::console::factory::Command( + .add("dump", console::factory::Command( senf::membind(&ModuleManager::dumpModules, this)) .doc("Dump complete PPI structure\n" "The dump will contain one paragraph for each module. The first line gives module\n" "information, additional lines list all connectors and their peers (if connected).\n" "\n" - "This information can be processed by 'PPI/drawmodules.py' and 'dot' (from the\n" + "This information can be processed by 'tools/drawmodules.py' and 'dot' (from the\n" "graphviz package) to generate a graphic representation of the module structure:\n" "\n" " $ echo /sys/ppi/dump | nc -q1 \\\n" - " | python PPI/drawmodules.py | dot -Tpng /dev/fd/0 >modules.png\n") + " | python tools/drawmodules.py | dot -Tpng /dev/fd/0 >modules.png\n") ); } prefix_ void senf::ppi::ModuleManager::dumpModules(std::ostream & os) + const { for (ModuleRegistry::const_iterator i (moduleRegistry_.begin()), i_end (moduleRegistry_.end()); i != i_end; ++i) { @@ -99,15 +100,19 @@ prefix_ void senf::ppi::ModuleManager::dumpModules(std::ostream & os) for (module::Module::ConnectorRegistry::iterator j ((*i)->connectorRegistry_.begin()), j_end ((*i)->connectorRegistry_.end()); j != j_end; ++j) { os << " " << *j << " " << prettyName(typeid(**j)); - if ((**j).connected()) + if ((**j).connected()) { os << " " << & (*j)->peer(); + connector::PassiveConnector * pc (dynamic_cast(*j)); + if (pc && pc->throttled()) + os << " throttled"; + } os << "\n"; } os << "\n"; } } -///////////////////////////////cc.e//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// #undef prefix_ //#include "ModuleManager.mpp"