Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::concept::Collection< T, E > Class Template Reference

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

Classes

class  Iterator
 

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)
 

Detailed Description

template<class T, template< class _ > class E = Equiv<T>>
class elm::concept::Collection< T, E >

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

Parameters
TType of items stored in the collection.
EEquivallence relation to use.
Implemented by:
elm::genstruct::DLList, elm::genstruct::SLList

Member Function Documentation

template<class T, template< class _ > class E = Equiv<T>>
bool elm::concept::Collection< T, E >::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.
template<class T, template< class _ > class E = Equiv<T>>
template<template< class _ > class C>
bool Collection::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.

Test if a collection is contained in the current collection.

Parameters
valuesCollection to test.
Returns
True if the current collection contains all values of the given collection, false else.
template<class T, template< class _ > class E = Equiv<T>>
int elm::concept::Collection< T, E >::count ( void  )

Get the number of elements in the collection.

Returns
Number of items.
template<class T, template< class _ > class E = Equiv<T>>
bool elm::concept::Collection< T, E >::isEmpty ( void  )

Test if the collection si empty.

Returns
True if the collection is empty, false else.
template<class T, template< class _ > class E = Equiv<T>>
Collection::operator bool ( void  )

Same as isEmpty().

Same as not isEmpty().


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