summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHuynh Tran <nthuynh75@gmail.com>2005-06-17 22:11:43 +0000
committerHuynh Tran <nthuynh75@gmail.com>2005-06-17 22:11:43 +0000
commit7ee6a7473b104e1912221714215392306ecf2e0e (patch)
tree379480dad665c602dbab77837d34a7e08db8e44a /src
parent2224209b0e1a6189e839ed62c4434c16aacca6ce (diff)
downloadmanaserv-7ee6a7473b104e1912221714215392306ecf2e0e.tar.gz
manaserv-7ee6a7473b104e1912221714215392306ecf2e0e.tar.bz2
manaserv-7ee6a7473b104e1912221714215392306ecf2e0e.tar.xz
manaserv-7ee6a7473b104e1912221714215392306ecf2e0e.zip
Force a user class to use the Storage singleton instead of instantiating DALStorage directly.
Diffstat (limited to 'src')
-rw-r--r--src/dalstorage.h45
1 files changed, 33 insertions, 12 deletions
diff --git a/src/dalstorage.h b/src/dalstorage.h
index 0bde7d33..a95ede9f 100644
--- a/src/dalstorage.h
+++ b/src/dalstorage.h
@@ -37,23 +37,18 @@ namespace tmwserv
/**
* A storage class that relies on DAL.
+ *
+ * Notes:
+ * - this class cannot be instanciated nor duplicated in order to force
+ * a user class to use the Storage singleton.
*/
class DALStorage: public Storage
{
- public:
- /**
- * Constructor.
- */
- DALStorage(void);
-
-
- /**
- * Destructor.
- */
- ~DALStorage(void)
- throw();
+ // friend so that Storage can call the constructor.
+ friend class Storage;
+ public:
/**
* Save changes to the database permanently.
*/
@@ -83,6 +78,32 @@ class DALStorage: public Storage
private:
/**
+ * Constructor.
+ */
+ DALStorage(void);
+
+
+ /**
+ * Destructor.
+ */
+ ~DALStorage(void)
+ throw();
+
+
+ /**
+ * Copy constructor.
+ */
+ DALStorage(const DALStorage& rhs);
+
+
+ /**
+ * Assignment operator.
+ */
+ DALStorage&
+ operator=(const DALStorage& rhs);
+
+
+ /**
* Connect to the database and initialize it if necessary.
*/
void