#include <storage.hpp>
Inheritance diagram for Storage:

Notes:
Definition at line 48 of file storage.hpp.
Public Member Functions | |
| virtual void | open (void)=0 |
| Open the storage for read/write access. | |
| virtual void | close (void)=0 |
| Close the storage. | |
| bool | isOpen (void) const |
| Check if the storage is open. | |
| const std::string & | getName (void) const |
| Get the storage name. | |
| void | setUser (const std::string &userName) |
| Set a user name for the storage. | |
| const std::string & | getUser (void) const |
| Get the user name. | |
| void | setPassword (const std::string &password) |
| Set a user password for the storage. | |
| const std::string & | getPassword (void) const |
| Get the user password. | |
| virtual AccountPtr | getAccount (const std::string &userName)=0 |
| Get an account by user name. | |
| virtual AccountPtr | getAccountByID (int accountID)=0 |
| Get an account by ID. | |
| virtual CharacterPtr | getCharacter (int id)=0 |
| Gets a character by database ID. | |
| virtual void | addAccount (const AccountPtr &account)=0 |
| Add a new account. | |
| virtual void | delAccount (AccountPtr const &account)=0 |
| Delete an account. | |
| virtual void | unloadAccount (AccountPtr const &account)=0 |
| Flush and unload an account. | |
| virtual std::list< std::string > | getEmailList ()=0 |
| Get the list of Emails in the accounts list. | |
| virtual bool | doesEmailAddressExist (std::string const &email)=0 |
| Tells if the email address already exists. | |
| virtual bool | doesCharacterNameExist (std::string const &name)=0 |
| Tells if the character's name already exists. | |
| virtual bool | updateCharacter (CharacterPtr ptr)=0 |
| Updates the data for a single character, does not update the owning account or the characters name. | |
| virtual std::map< short, ChatChannel > | getChannelList ()=0 |
| Gives the list of opened public channels registered in database. | |
| virtual void | updateChannels (std::map< short, ChatChannel > &channelList)=0 |
| apply channel differences from the list in memory to the one in db. | |
| virtual void | flushAll ()=0 |
| Saves the changes to all the accounts permanently. | |
| virtual void | flush (AccountPtr const &account)=0 |
| Saves the changes to one account permanently. | |
Static Public Member Functions | |
| Storage & | instance (const std::string &name) |
| Create a named instance of Storage. | |
| void | destroy (void) |
| Delete the storage. | |
Protected Member Functions | |
| Storage (void) throw () | |
| Default constructor. | |
| virtual | ~Storage (void) throw () |
| Destructor. | |
| Storage (const Storage &rhs) | |
| Copy constructor. | |
| Storage & | operator= (const Storage &rhs) |
| Assignment operator. | |
Protected Attributes | |
| Accounts | mAccounts |
| list of accounts in memory | |
| Characters | mCharacters |
| the loaded characters | |
| bool | mIsOpen |
| flag is true if the storage is open | |
Static Private Attributes | |
| Storage * | mInstance = 0 |
| the unique instance of Storage | |
| std::string | mName |
| the name of the storage | |
| std::string | mUser |
| the user name | |
| std::string | mPassword |
| the user password | |
|
|
Default constructor.
Definition at line 36 of file storage.cpp. |
|
|
Destructor.
Definition at line 46 of file storage.cpp. |
|
|
Copy constructor.
|
|
|
Add a new account.
Implemented in DALStorage. |
|
|
Close the storage. Depending on the underlying implementation of Storage, closing a storage would mean either closing a file or disconnecting from a database. Implemented in DALStorage. |
|
|
Delete an account.
Implemented in DALStorage. |
|
|
Delete the storage.
Definition at line 74 of file storage.cpp. |
|
|
Tells if the character's name already exists.
Implemented in DALStorage. |
|
|
Tells if the email address already exists.
Implemented in DALStorage. |
|
|
Saves the changes to one account permanently.
Implemented in DALStorage. |
|
|
Saves the changes to all the accounts permanently.
Implemented in DALStorage. |
|
|
Get an account by user name.
Implemented in DALStorage. |
|
|
Get an account by ID.
Implemented in DALStorage. |
|
|
Gives the list of opened public channels registered in database.
Implemented in DALStorage. |
|
|
Gets a character by database ID.
Implemented in DALStorage. |
|
|
Get the list of Emails in the accounts list.
Implemented in DALStorage. |
|
|
Get the storage name.
Definition at line 102 of file storage.cpp. |
|
|
Get the user password.
Definition at line 142 of file storage.cpp. |
|
|
Get the user name.
Definition at line 122 of file storage.cpp. |
|
|
Create a named instance of Storage.
Definition at line 57 of file storage.cpp. |
|
|
Check if the storage is open.
Definition at line 92 of file storage.cpp. |
|
|
Open the storage for read/write access. Depending on the underlying implementation of Storage, opening a storage would mean either opening a file or connecting to a database. Implemented in DALStorage. |
|
|
Assignment operator.
|
|
|
Set a user password for the storage. Depending on the underlying implementation of Storage, setting the user password may have no effect (e.g. DALStorage running on SQLite).
Definition at line 132 of file storage.cpp. |
|
|
Set a user name for the storage. Depending on the underlying implementation of Storage, setting the user name may have no effect (e.g. DALStorage running on SQLite).
Definition at line 112 of file storage.cpp. |
|
|
Flush and unload an account.
Implemented in DALStorage. |
|
|
apply channel differences from the list in memory to the one in db.
Implemented in DALStorage. |
|
|
Updates the data for a single character, does not update the owning account or the characters name. Primary usage should be storing characterdata received from a game server. returns true if succefull, false otherwise. Implemented in DALStorage. |
|
|
list of accounts in memory
Definition at line 308 of file storage.hpp. |
|
|
the loaded characters
Definition at line 309 of file storage.hpp. |
|
|
the unique instance of Storage
Definition at line 27 of file storage.cpp. |
|
|
flag is true if the storage is open
Definition at line 310 of file storage.hpp. |
|
|
the name of the storage
|
|
|
the user password
|
|
|
the user name
|
1.3.9.1