#include <Repository.h>
Public Types | |
typedef T * | value_type |
typedef size_t | size_type |
typedef std::vector< value_type > | list_t |
typedef std::vector< value_type >::iterator | iterator |
typedef std::vector< value_type >::const_iterator | const_iterator |
Public Member Functions | |
Repository () | |
Constructor. | |
virtual | ~Repository () |
Destructor. | |
iterator | begin () |
Get iterator to the first element of the repository. | |
const_iterator | begin () const |
Get constant iterator to the first element of the repository. | |
iterator | end () |
Get iterator to the end of the repository. | |
const_iterator | end () const |
Get constant iterator to the end of the repository. | |
bool | empty () const |
Return true if repository is empty. | |
size_type | size () const |
Return number of elements in the repository. | |
void | push_back (const value_type &x_) |
Add new element to the repository. | |
void | erase (iterator position_) |
Remove element at the position_ iterator. | |
bool | erase (const value_type &x_) |
Remove element. | |
void | clear () |
Empty repository. | |
Private Attributes | |
list_t * | m_collection |
Definition at line 33 of file Repository.h.
typedef std::vector<value_type>::const_iterator ASSA::Repository< T >::const_iterator |
Definition at line 41 of file Repository.h.
typedef std::vector<value_type>::iterator ASSA::Repository< T >::iterator |
Definition at line 40 of file Repository.h.
typedef std::vector<value_type> ASSA::Repository< T >::list_t |
Definition at line 39 of file Repository.h.
typedef size_t ASSA::Repository< T >::size_type |
Definition at line 37 of file Repository.h.
typedef T* ASSA::Repository< T >::value_type |
Definition at line 36 of file Repository.h.
ASSA::Repository< T >::Repository | ( | ) | [inline] |
Constructor.
Definition at line 45 of file Repository.h.
References ASSA::Repository< T >::m_collection.
00045 { 00046 m_collection = new list_t; 00047 }
virtual ASSA::Repository< T >::~Repository | ( | ) | [inline, virtual] |
Destructor.
Definition at line 50 of file Repository.h.
References ASSA::Repository< T >::clear(), and ASSA::Repository< T >::m_collection.
00050 { 00051 if (m_collection) { clear (); delete m_collection; } 00052 }
const_iterator ASSA::Repository< T >::begin | ( | ) | const [inline] |
Get constant iterator to the first element of the repository.
Definition at line 58 of file Repository.h.
References ASSA::Repository< T >::m_collection.
00058 { return m_collection->begin (); }
iterator ASSA::Repository< T >::begin | ( | ) | [inline] |
Get iterator to the first element of the repository.
Definition at line 55 of file Repository.h.
References ASSA::Repository< T >::m_collection.
Referenced by ASSA::Repository< T >::erase().
00055 { return m_collection->begin (); }
void ASSA::Repository< T >::clear | ( | ) | [inline] |
Empty repository.
Definition at line 90 of file Repository.h.
References ASSA::Repository< T >::m_collection.
Referenced by ASSA::Repository< T >::~Repository().
00090 { 00091 m_collection->erase (m_collection->begin (), m_collection->end ()); 00092 }
bool ASSA::Repository< T >::empty | ( | ) | const [inline] |
Return true if repository is empty.
Definition at line 67 of file Repository.h.
References ASSA::Repository< T >::m_collection.
00067 { return m_collection->empty (); }
const_iterator ASSA::Repository< T >::end | ( | ) | const [inline] |
Get constant iterator to the end of the repository.
Definition at line 64 of file Repository.h.
References ASSA::Repository< T >::m_collection.
00064 { return m_collection->end (); }
iterator ASSA::Repository< T >::end | ( | ) | [inline] |
Get iterator to the end of the repository.
Definition at line 61 of file Repository.h.
References ASSA::Repository< T >::m_collection.
Referenced by ASSA::Repository< T >::erase().
00061 { return m_collection->end (); }
bool ASSA::Repository< T >::erase | ( | const value_type & | x_ | ) | [inline] |
Remove element.
Definition at line 81 of file Repository.h.
References ASSA::Repository< T >::begin(), ASSA::Repository< T >::end(), and ASSA::Repository< T >::erase().
00081 { 00082 iterator it = begin (); 00083 while (it != end ()) { 00084 if ((*it) == x_) { erase (it); break; } 00085 it++; 00086 } 00087 }
void ASSA::Repository< T >::erase | ( | iterator | position_ | ) | [inline] |
Remove element at the position_ iterator.
Definition at line 76 of file Repository.h.
References ASSA::Repository< T >::m_collection.
Referenced by ASSA::Repository< T >::erase().
00076 { m_collection->erase (position_); }
void ASSA::Repository< T >::push_back | ( | const value_type & | x_ | ) | [inline] |
Add new element to the repository.
Definition at line 73 of file Repository.h.
References ASSA::Repository< T >::m_collection.
00073 { m_collection->push_back (x_); }
size_type ASSA::Repository< T >::size | ( | ) | const [inline] |
Return number of elements in the repository.
Definition at line 70 of file Repository.h.
References ASSA::Repository< T >::m_collection.
00070 { return m_collection->size (); }
list_t* ASSA::Repository< T >::m_collection [private] |
Definition at line 95 of file Repository.h.
Referenced by ASSA::Repository< T >::begin(), ASSA::Repository< T >::clear(), ASSA::Repository< T >::empty(), ASSA::Repository< T >::end(), ASSA::Repository< T >::erase(), ASSA::Repository< T >::push_back(), ASSA::Repository< T >::Repository(), ASSA::Repository< T >::size(), and ASSA::Repository< T >::~Repository().