Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
MutableCollection< T > Class Template Reference

#include </home/casse/Dev/elm/src/concepts.h>

+ Inheritance diagram for MutableCollection< T >:

Public Member Functions

MutableIter< T > begin ()
 
MutableIter< T > end ()
 
void clear (void)
 
void add (const T &item)
 
void addAll (const Collection< T > &items)
 
void remove (const T &item)
 
void removeAll (const Collection< T > &items)
 
void remove (const Iterator< T > &iter)
 
MutableCollection< T > & operator+= (const T &item)
 
MutableCollection< T > & operator-= (const T &item)
 
void copy (const Collection< T > &items)
 
MutableCollectionoperator= (const Collection< T > &c)
 
- Public Member Functions inherited from Collection< T >
int count (void)
 
bool contains (const T &item)
 
template<template< class _ > class C>
bool containsAll (const C< T > &collection)
 
bool isEmpty (void)
 
 operator bool (void)
 
Iter begin (void) const
 
Iter end (void) const
 
bool equals (const Collection &coll)
 
bool operator== (const Collection &coll)
 
bool operator!= (const Collection &coll)
 

Additional Inherited Members

- Public Types inherited from Collection< T >
typedef T t
 
typedef Collection< T > self_t
 
- Static Public Attributes inherited from Collection< T >
static const Collection null
 
static const Collection< T > null
 

Detailed Description

template<class T>
class elm::concept::MutableCollection< T >

This concept provides way to have collections whose content may be modified.

Parameters
TType of items in the collection.
Implemented by:

Member Function Documentation

◆ add()

void add ( const T &  item)

Add an item to the collection.

Parameters
itemItem to add.

◆ addAll()

void addAll ( const Collection< T > &  items)

Add a collection to the current one.

Parameters
itemsCollection of items to add.

◆ begin()

MutableIter<T> begin ( )

Get a mutable iterator on the first element of the collection.

Returns
First element mutable iterator.

◆ clear()

void clear ( void  )

Remove all items from the collection.

◆ copy()

void copy ( const Collection< T > &  items)

Reset the current collection and copy the given one.

Parameters
itemsCollection to copy.

◆ end()

MutableIter<T> end ( )

Get a mutable iterator at the end of the collection.

Returns
Mutable iterator at the end of the collection.

◆ operator+=()

MutableCollection<T>& operator+= ( const T &  item)

Same as insert().

◆ operator-=()

MutableCollection<T>& operator-= ( const T &  item)

Same as remove().

◆ operator=()

MutableCollection& operator= ( const Collection< T > &  c)

Copy in the current collection the given collection.

Parameters
cCollection to copy.
Returns
This collection.

◆ remove() [1/2]

void remove ( const Iterator< T > &  iter)

Remove a value using an iterator.

Parameters
iterIter giving the item to remove.

◆ remove() [2/2]

void remove ( const T &  item)

Remove the given item from the collection.

Parameters
itemItem to remove from the collection.

◆ removeAll()

void removeAll ( const Collection< T > &  items)

Remove a collection from the current one.

Parameters
itemsItems to remove.

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