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/command_table.cpp b/command_table.cpp
index 1d9e063..a42d981 100644
--- a/command_table.cpp
+++ b/command_table.cpp
@@ -62,8 +62,7 @@
return;
}
std::shared_ptr<session::Session> session =
- std::get<session::Manager&>(singletonPool)
- .getSession(handler->sessionID);
+ session::Manager::get().getSession(handler->sessionID);
// Ignore messages that are not part of an active session
auto state = static_cast<session::State>(session->state());
@@ -122,8 +121,7 @@
if (handler->sessionID != session::sessionZero)
{
std::shared_ptr<session::Session> session =
- std::get<session::Manager&>(singletonPool)
- .getSession(handler->sessionID);
+ session::Manager::get().getSession(handler->sessionID);
auto state = static_cast<session::State>(session->state());
if ((state != session::State::setupInProgress) &&
(state != session::State::active))