Adonthell
0.4
|
Base storage class. More...
#include <storage.h>
Public Types | |
typedef hash_map< string, s_int32 >::iterator | iterator |
Storage iterator, similar to STL iterator. More... | |
Public Member Functions | |
storage () | |
Default constructor. More... | |
~storage () | |
Destructor. More... | |
void | set_val (string key, s_int32 value) |
Sets key to value. More... | |
s_int32 | get_val (string key) |
Returns the value of a key. More... | |
pair< string, s_int32 > | next () |
Returns the next (key, value) pair of the storage. More... | |
s_int32 & | operator[] (string key) |
Returns the value of a key. More... | |
iterator | begin () |
Returns an iterator to the beginning of the storage. More... | |
iterator | end () |
Returns an iterator to the end of the storage. More... | |
u_int32 | size () const |
Returns the size (number of elements) of the storage. More... | |
Base storage class.
If you want to access attributes of an object of yours you have to derive that object's class from 'storage' and store the attributes in the hash_map.
typedef hash_map<string, s_int32>::iterator storage::iterator |
storage::~storage | ( | ) |
Destructor.
Definition at line 31 of file storage.cc.
void storage::set_val | ( | string | key, |
s_int32 | value | ||
) |
s_int32 storage::get_val | ( | string | key) |
Returns the value of a key.
key | key to return. |
Definition at line 50 of file storage.cc.
pair< string, s_int32 > storage::next | ( | ) |
Returns the next (key, value) pair of the storage.
Definition at line 69 of file storage.cc.
s_int32 & storage::operator[] | ( | string | key) |
Returns the value of a key.
key | key to return |
Definition at line 63 of file storage.cc.
|
inline |
|
inline |
|
inline |