Adonthell  0.4
storage Class Reference

Base storage class. More...

#include <storage.h>

Inheritance diagram for storage:

Public Types

typedef hash_map< string,
s_int32 >::iterator 
iterator
 Storage iterator, similar to STL iterator.

Public Member Functions

 storage ()
 Default constructor.
 ~storage ()
 Destructor.
void set_val (string key, s_int32 value)
 Sets key to value.
s_int32 get_val (string key)
 Returns the value of a key.
pair< string, s_int32next ()
 Returns the next (key, value) pair of the storage.
s_int32operator[] (string key)
 Returns the value of a key.
iterator begin ()
 Returns an iterator to the beginning of the storage.
iterator end ()
 Returns an iterator to the end of the storage.
u_int32 size () const
 Returns the size (number of elements) of the storage.

Detailed Description

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.

Definition at line 47 of file storage.h.

Member Typedef Documentation

typedef hash_map<string, s_int32>::iterator storage::iterator

Storage iterator, similar to STL iterator.

Definition at line 114 of file storage.h.

Constructor & Destructor Documentation

storage::storage ( )
inline

Default constructor.

Definition at line 54 of file storage.h.

storage::~storage ( )

Destructor.

Definition at line 31 of file storage.cc.

Member Function Documentation

void storage::set_val ( string  key,
s_int32  value 
)

Sets key to value.

Parameters
keykey.
valuevalue.

Definition at line 37 of file storage.cc.

s_int32 storage::get_val ( string  key)

Returns the value of a key.

Parameters
keykey to return.
Returns
value of key.

Definition at line 50 of file storage.cc.

pair< string, s_int32 > storage::next ( )

Returns the next (key, value) pair of the storage.

Returns
Next element.

Definition at line 69 of file storage.cc.

s_int32 & storage::operator[] ( string  key)

Returns the value of a key.

Attention
Not available from Python. From Python, use get () instead.
Parameters
keykey to return
Returns
value of key.

Definition at line 63 of file storage.cc.

iterator storage::begin ( )
inline

Returns an iterator to the beginning of the storage.

Returns
iterator to the beginning of the storage.

Definition at line 122 of file storage.h.

iterator storage::end ( )
inline

Returns an iterator to the end of the storage.

Returns
iterator to the end of the storage.

Definition at line 133 of file storage.h.

u_int32 storage::size ( ) const
inline

Returns the size (number of elements) of the storage.

Returns
size of the storage.

Definition at line 144 of file storage.h.


The documentation for this class was generated from the following files: