From 389960211861736ef321df82f6abcb59f6302897 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 17 Dec 2008 21:32:20 +0100 Subject: Sinnlose Klassen SharedPtr und SingletonPtr entfernt --- src/Core/ConnectionManager.cpp | 6 +++--- src/Core/ConnectionManager.h | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/Core') diff --git a/src/Core/ConnectionManager.cpp b/src/Core/ConnectionManager.cpp index 63b29e1..c347e29 100644 --- a/src/Core/ConnectionManager.cpp +++ b/src/Core/ConnectionManager.cpp @@ -42,7 +42,7 @@ namespace Mad { namespace Core { -Common::SingletonPtr ConnectionManager::connectionManager; +ConnectionManager ConnectionManager::connectionManager; void ConnectionManager::updateState(const std::string &name, Common::HostInfo::State state) { @@ -129,7 +129,7 @@ void ConnectionManager::configFinished() { } } -ConnectionManager::ConnectionManager() { +void ConnectionManager::doInit() { Common::RequestManager::get()->setCore(true); Net::Connection::init(); @@ -146,7 +146,7 @@ ConnectionManager::ConnectionManager() { Common::RequestManager::get()->registerPacketType(Net::Packet::LOG); } -ConnectionManager::~ConnectionManager() { +void ConnectionManager::doDeinit() { for(std::list::iterator con = daemonConnections.begin(); con != daemonConnections.end(); ++con) delete *con; diff --git a/src/Core/ConnectionManager.h b/src/Core/ConnectionManager.h index fdc8a46..4623ab6 100644 --- a/src/Core/ConnectionManager.h +++ b/src/Core/ConnectionManager.h @@ -29,7 +29,6 @@ #include #include #include -#include #include @@ -46,7 +45,7 @@ namespace Core { class ConnectionManager : public Common::Configurable, public Common::Initializable { private: - static Common::SingletonPtr connectionManager; + static ConnectionManager connectionManager; std::string x509TrustFile, x509CrlFile, x509CertFile, x509KeyFile; @@ -67,16 +66,18 @@ class ConnectionManager : public Common::Configurable, public Common::Initializa void updateState(const std::string &name, Common::HostInfo::State state); + ConnectionManager() {} + protected: virtual bool handleConfigEntry(const Common::ConfigEntry &entry, bool handled); virtual void configFinished(); - public: - ConnectionManager(); - virtual ~ConnectionManager(); + virtual void doInit(); + virtual void doDeinit(); + public: static ConnectionManager* get() { - return connectionManager.get(); + return &connectionManager; } void run(); -- cgit v1.2.3