summaryrefslogtreecommitdiffstats
path: root/src/Core
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-12-17 21:32:20 +0100
committerMatthias Schiffer <matthias@gamezock.de>2008-12-17 21:32:20 +0100
commit389960211861736ef321df82f6abcb59f6302897 (patch)
treecbf44ddc93736ad8f059b947a08c26a31d242ee7 /src/Core
parente28a9c25c143635ffe8a1f9cee1d377a69a4f923 (diff)
downloadmad-389960211861736ef321df82f6abcb59f6302897.tar
mad-389960211861736ef321df82f6abcb59f6302897.zip
Sinnlose Klassen SharedPtr und SingletonPtr entfernt
Diffstat (limited to 'src/Core')
-rw-r--r--src/Core/ConnectionManager.cpp6
-rw-r--r--src/Core/ConnectionManager.h13
2 files changed, 10 insertions, 9 deletions
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::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<RequestHandlers::LogRequestHandler>(Net::Packet::LOG);
}
-ConnectionManager::~ConnectionManager() {
+void ConnectionManager::doDeinit() {
for(std::list<Net::ServerConnection*>::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 <Common/HostInfo.h>
#include <Common/Initializable.h>
#include <Common/RequestManager.h>
-#include <Common/SingletonPtr.h>
#include <Net/IPAddress.h>
@@ -46,7 +45,7 @@ namespace Core {
class ConnectionManager : public Common::Configurable, public Common::Initializable {
private:
- static Common::SingletonPtr<ConnectionManager> 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();