Loading...
Searching...
No Matches
ASSA::Repository< T > Class Template Reference

`#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

## Detailed Description

template<typename T>
class ASSA::Repository< T >

Definition at line 33 of file Repository.h.

## Member Typedef Documentation

## const_iterator

template<typename T >

typedef std::vector<value_type>::const_iterator ASSA::Repository< T >::const_iterator

Definition at line 41 of file Repository.h.

## iterator

template<typename T >

typedef std::vector<value_type>::iterator ASSA::Repository< T >::iterator

Definition at line 40 of file Repository.h.

## list_t

template<typename T >

typedef std::vector<value_type> ASSA::Repository< T >::list_t

Definition at line 39 of file Repository.h.

## size_type

template<typename T >

typedef size_t ASSA::Repository< T >::size_type

Definition at line 37 of file Repository.h.

## value_type

template<typename T >

typedef T* ASSA::Repository< T >::value_type

Definition at line 36 of file Repository.h.

## Constructor & Destructor Documentation

## Repository()

template<typename T >

ASSA::Repository< T >::Repository | ( |  | ) |

inline

Constructor.

Definition at line 45 of file Repository.h.

{
m_collection = new list_t;
}
ASSA::Repository::m_collection
list_t * m_collection
Definition Repository.h:95
ASSA::Repository::list_t
std::vector< value_type > list_t
Definition Repository.h:39

References ASSA::Repository< T >::m_collection.

## ~Repository()

template<typename T >

virtual ASSA::Repository< T >::~Repository | ( |  | ) |

inline virtual

Destructor.

Definition at line 50 of file Repository.h.

{
if (m_collection) { clear (); delete m_collection; }
}
ASSA::Repository::clear
void clear()
Empty repository.
Definition Repository.h:90

References ASSA::Repository< T >::clear(), and ASSA::Repository< T >::m_collection.

## Member Function Documentation

## begin() [1/2]

template<typename T >

iterator ASSA::Repository< T >::begin | ( |  | ) |

inline

Get iterator to the first element of the repository.

Definition at line 55 of file Repository.h.

{ return m_collection->begin (); }

References ASSA::Repository< T >::m_collection.

Referenced by ASSA::Repository< T >::erase().

## begin() [2/2]

template<typename T >

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.

{ return m_collection->begin (); }

References ASSA::Repository< T >::m_collection.

## clear()

template<typename T >

void ASSA::Repository< T >::clear | ( |  | ) |

inline

Empty repository.

Definition at line 90 of file Repository.h.

{
m_collection->erase (m_collection->begin (), m_collection->end ());
}

References ASSA::Repository< T >::m_collection.

Referenced by ASSA::Repository< T >::~Repository().

## empty()

template<typename T >

bool ASSA::Repository< T >::empty | ( |  | ) | const

inline

Return true if repository is empty.

Definition at line 67 of file Repository.h.

{ return m_collection->empty (); }

References ASSA::Repository< T >::m_collection.

## end() [1/2]

template<typename T >

iterator ASSA::Repository< T >::end | ( |  | ) |

inline

Get iterator to the end of the repository.

Definition at line 61 of file Repository.h.

{ return m_collection->end (); }

References ASSA::Repository< T >::m_collection.

Referenced by ASSA::Repository< T >::erase().

## end() [2/2]

template<typename T >

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.

{ return m_collection->end (); }

References ASSA::Repository< T >::m_collection.

## erase() [1/2]

template<typename T >

bool ASSA::Repository< T >::erase | ( | const value_type & | x_ | ) |

inline

Remove element.

Returns
  true if element was found and erased; false otherwise

Definition at line 81 of file Repository.h.

{
iterator it = begin ();
while (it != end ()) {
if ((*it) == x_) { erase (it); break; }
it++;
}
}
ASSA::Repository::begin
iterator begin()
Get iterator to the first element of the repository.
Definition Repository.h:55
ASSA::Repository::erase
void erase(iterator position_)
Remove element at the position_ iterator.
Definition Repository.h:76
ASSA::Repository::iterator
std::vector< value_type >::iterator iterator
Definition Repository.h:40
ASSA::Repository::end
iterator end()
Get iterator to the end of the repository.
Definition Repository.h:61

References ASSA::Repository< T >::begin(), ASSA::Repository< T >::end(), and ASSA::Repository< T >::erase().

## erase() [2/2]

template<typename T >

void ASSA::Repository< T >::erase | ( | iterator | position_ | ) |

inline

Remove element at the position_ iterator.

Definition at line 76 of file Repository.h.

{ m_collection->erase (position_); }

References ASSA::Repository< T >::m_collection.

Referenced by ASSA::Repository< T >::erase().

## push_back()

template<typename T >

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.

{ m_collection->push_back (x_); }

References ASSA::Repository< T >::m_collection.

## size()

template<typename T >

size_type ASSA::Repository< T >::size | ( |  | ) | const

inline

Return number of elements in the repository.

Definition at line 70 of file Repository.h.

{ return m_collection->size (); }

References ASSA::Repository< T >::m_collection.

## Member Data Documentation

## m_collection

template<typename T >

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 >::begin(), ASSA::Repository< T >::clear(), ASSA::Repository< T >::empty(), ASSA::Repository< T >::end(), 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().

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

- Repository.h