diff options
author | Stijn Buys <ingar@osirion.org> | 2008-02-01 19:34:47 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-02-01 19:34:47 +0000 |
commit | 6c8446cddb37df732fc9e5fc21f98e31968ce634 (patch) | |
tree | 25515ae78969e2f0ef216a5cbef8a650b217e8f8 /src/common/consoleinterface.cc | |
parent | f794b9ee52293cefd6ac73fdf0d2a01c5388f057 (diff) |
interface cleanup
Diffstat (limited to 'src/common/consoleinterface.cc')
-rw-r--r-- | src/common/consoleinterface.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/common/consoleinterface.cc b/src/common/consoleinterface.cc new file mode 100644 index 0000000..eb532c6 --- /dev/null +++ b/src/common/consoleinterface.cc @@ -0,0 +1,36 @@ +/* + common/consoleinterface.cc + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +#include "common/consoleinterface.h" + +#include <iostream> + +#include <stdlib.h> + +namespace common { + +ConsoleInterface *ConsoleInterface::consoleinterface_instance = 0; + +ConsoleInterface::ConsoleInterface() { + if (consoleinterface_instance) { + std::cerr << "multiple singleton instances: common::ConsoleInterface" << std::endl; + exit(2); + } + consoleinterface_instance = this; +} + +ConsoleInterface::~ConsoleInterface() +{ + consoleinterface_instance = 0; +} + +ConsoleInterface *ConsoleInterface::instance() +{ + return consoleinterface_instance; +} + +} // namespace common + |