diff options
author | Huynh Tran <nthuynh75@gmail.com> | 2005-06-21 19:46:40 +0000 |
---|---|---|
committer | Huynh Tran <nthuynh75@gmail.com> | 2005-06-21 19:46:40 +0000 |
commit | 49d79a345c8c4929d9bb787af9f4f0090c888537 (patch) | |
tree | 387b3a8d738d570ad1493be0273751c7a145cf20 /src/dalstorage.h | |
parent | 816d8acd16faeb20713c3d09466003a444940f6f (diff) | |
download | manaserv-49d79a345c8c4929d9bb787af9f4f0090c888537.tar.gz manaserv-49d79a345c8c4929d9bb787af9f4f0090c888537.tar.bz2 manaserv-49d79a345c8c4929d9bb787af9f4f0090c888537.tar.xz manaserv-49d79a345c8c4929d9bb787af9f4f0090c888537.zip |
Improved Storage APIs and moved debug code to unit tests.
Diffstat (limited to 'src/dalstorage.h')
-rw-r--r-- | src/dalstorage.h | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/src/dalstorage.h b/src/dalstorage.h index 59a3eb3b..78a689c7 100644 --- a/src/dalstorage.h +++ b/src/dalstorage.h @@ -51,6 +51,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. * * @param userName the owner of the account. @@ -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: @@ -114,13 +128,6 @@ class DALStorage: public Storage /** - * Connect to the database and initialize it if necessary. - */ - void - connect(void); - - - /** * Create the specified table. * * @param tblName the table name. @@ -135,9 +142,6 @@ class DALStorage: public Storage private: std::auto_ptr<dal::DataProvider> mDb; /**< the data provider */ - typedef std::vector<Account*> Accounts; - Accounts mAccounts; /**< the loaded accounts */ - Beings mCharacters; /**< the loaded characters */ }; |