From 49d79a345c8c4929d9bb787af9f4f0090c888537 Mon Sep 17 00:00:00 2001 From: Huynh Tran Date: Tue, 21 Jun 2005 19:46:40 +0000 Subject: Improved Storage APIs and moved debug code to unit tests. --- src/dalstorage.h | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'src/dalstorage.h') diff --git a/src/dalstorage.h b/src/dalstorage.h index 59a3eb3b..78a689c7 100644 --- a/src/dalstorage.h +++ b/src/dalstorage.h @@ -50,6 +50,20 @@ class DALStorage: public Storage public: + /** + * Connect to the database and initialize it if necessary. + */ + void + open(void); + + + /** + * Disconnect from the database. + */ + void + close(void); + + /** * Get an account by user name. * @@ -67,23 +81,23 @@ class DALStorage: public Storage * @param account the new account. */ void - addAccount(const Account* account); + addAccount(Account* account); /** - * Save changes to the database permanently. + * Delete an account. + * + * @param userName the owner of the account. */ void - flush(void); + delAccount(const std::string& userName); /** - * Get the number of Accounts saved in database (test function). - * - * @return the number of Accounts. + * Save changes to the database permanently. */ - unsigned int - getAccountCount(void); + void + flush(void); private: @@ -113,13 +127,6 @@ class DALStorage: public Storage operator=(const DALStorage& rhs); - /** - * Connect to the database and initialize it if necessary. - */ - void - connect(void); - - /** * Create the specified table. * @@ -135,9 +142,6 @@ class DALStorage: public Storage private: std::auto_ptr mDb; /**< the data provider */ - typedef std::vector Accounts; - Accounts mAccounts; /**< the loaded accounts */ - Beings mCharacters; /**< the loaded characters */ }; -- cgit v1.2.3-60-g2f50