From ed20c95fff998cb25457e5b9d95bce312816ebd9 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 12 Jun 2010 11:22:10 +0200 Subject: Created singleton for SmUberModel Implemented a singleton for SmUberModel. --- smubermodelsingleton.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 smubermodelsingleton.cpp (limited to 'smubermodelsingleton.cpp') diff --git a/smubermodelsingleton.cpp b/smubermodelsingleton.cpp new file mode 100644 index 0000000..ef3d1e3 --- /dev/null +++ b/smubermodelsingleton.cpp @@ -0,0 +1,18 @@ +/* + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. +*/ + +#include "smubermodelsingleton.h" +#include "smubermodel.h" + +SmUberModel *SmUberModelSingleton::mInstance = 0; + +SmUberModel *SmUberModelSingleton::instance(){ + if(!mInstance){ + mInstance = new SmUberModel; + } + return mInstance; +} -- cgit v1.2.3-70-g09d2