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

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

+ Inheritance diagram for Collection< T >:

Classes

class  Iter
 

Public Types

typedef T t
 
typedef Collection< T > self_t
 

Public Member Functions

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)
 

Static Public Attributes

static const Collection null
 
static const Collection< T > null
 

Detailed Description

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

This concepts provides methods to handle collection. A collection is an unordered list of items.

Parameters
TType of items stored in the collection.
Implemented by:

Member Typedef Documentation

◆ self_t

typedef Collection<T> self_t

Collection type.

◆ t

typedef T t

Type of values in the collection.

Member Function Documentation

◆ begin()

Iter begin ( void  ) const

Get an iterator on the collection.

Returns
Iterator.

◆ contains()

bool contains ( const T &  item)

Test if the item is containted in the collection.

Parameters
itemItem to test for.
Returns
True if the item is in the collection, false else.

◆ containsAll()

bool containsAll ( const C< T > &  collection)

Test if the given collection is contained in the current one.

Parameters
collectionCollection to test.
Returns
True if it is contained, false else.
Parameters
CType of the collection to test.

◆ count()

int count ( void  )

Get the number of elements in the collection.

Returns
Number of items.

◆ end()

Iter end ( void  ) const

Get an iterator on the end of the collection.

Returns
End iterator.

◆ equals()

bool equals ( const Collection< T > &  coll)

Test if both collections are equal.

Parameters
collCollection to compare with the current one.
Trueif both collections are equal, false.

◆ isEmpty()

bool isEmpty ( void  )

Test if the collection si empty.

Returns
True if the collection is empty, false else.

◆ operator bool()

operator bool ( void  )

Same as isEmpty().

◆ operator!=()

bool operator!= ( const Collection< T > &  coll)

Same as !equals().

◆ operator==()

bool operator== ( const Collection< T > &  coll)

Same as equals().

Member Data Documentation

◆ null [1/2]

const Collection null
static

Empty collection constant.

◆ null [2/2]

const Collection<T> null
static

Empty instance of the collection.


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