replace tuple-based singleton with individual singletons
The tuple-based singletons did not actually enforce singleton behavior
and the requirement of the accessor mechanism to include all of the
member types at once was starting to cause a header prerequisite
tangle. This removes the cross-dependencies and enforces actual
singletons by making a single way to access the class.
Tested: Run ipmitool to show that behavior has not changed
Change-Id: Ie966e1142363d279365b1095066380c8383e9f9b
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/sol_module.cpp b/sol_module.cpp
index 2b1fb46..d9a9a7c 100644
--- a/sol_module.cpp
+++ b/sol_module.cpp
@@ -1,7 +1,6 @@
#include "command/payload_cmds.hpp"
#include "command/sol_cmds.hpp"
#include "command_table.hpp"
-#include "main.hpp"
#include "session.hpp"
namespace sol
@@ -52,11 +51,10 @@
for (const auto& iter : commands)
{
- std::get<::command::Table&>(singletonPool)
- .registerCommand(iter.command,
- std::make_unique<::command::NetIpmidEntry>(
- iter.command, iter.functor, iter.privilege,
- iter.sessionless));
+ ::command::Table::get().registerCommand(
+ iter.command,
+ std::make_unique<::command::NetIpmidEntry>(
+ iter.command, iter.functor, iter.privilege, iter.sessionless));
}
}