2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief ModuleManager inline non-template implementation */
20 #define prefix_ inline
21 //-/////////////////////////////////////////////////////////////////////////////////////////////////
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 // senf::ppi::ModuleManager
26 prefix_ senf::ppi::ModuleManager & senf::ppi::ModuleManager::instance()
28 static ModuleManager manager;
32 prefix_ bool senf::ppi::ModuleManager::initializableRegistered(Initializable const & i)
35 return alive_ ? std::find(initQueue_.begin(), initQueue_.end(), &i) != initQueue_.end() : false;
38 prefix_ bool senf::ppi::ModuleManager::running()
44 prefix_ senf::console::DirectoryNode & senf::ppi::ModuleManager::consoleDir()
47 return consoleDir_.node();
50 //-/////////////////////////////////////////////////////////////////////////////////////////////////
51 // senf::ppi::ModuleManager::Initializable
53 prefix_ senf::ppi::ModuleManager::Initializable::Initializable()
55 enqueueInitializable();
58 prefix_ senf::ppi::ModuleManager::Initializable::~Initializable()
60 dequeueInitializable();
63 prefix_ void senf::ppi::ModuleManager::Initializable::enqueueInitializable()
65 moduleManager().registerInitializable(*this);
68 prefix_ void senf::ppi::ModuleManager::Initializable::dequeueInitializable()
70 moduleManager().unregisterInitializable(*this);
73 prefix_ bool senf::ppi::ModuleManager::Initializable::initializationScheduled()
76 return moduleManager().initializableRegistered(*this);
79 prefix_ senf::ppi::ModuleManager & senf::ppi::ModuleManager::Initializable::moduleManager()
82 return ModuleManager::instance();
85 //-/////////////////////////////////////////////////////////////////////////////////////////////////
93 // c-file-style: "senf"
94 // indent-tabs-mode: nil
95 // ispell-local-dictionary: "american"
96 // compile-command: "scons -u test"