Loading...
Searching...
No Matches
BALL::List< Value > Class Template Reference
Foundation Classes » General datastructures » Miscellaneous

`#include <BALL/DATATYPE/list.h>`

Inheritance diagram for BALL::List< Value >:

## Public Types

Type Definitions
typedef std::list< Value >::iterator | Iterator
typedef std::list< Value >::iterator | iterator
typedef std::list< Value >::const_iterator | ConstIterator
typedef std::list< Value >::const_iterator | const_iterator

## Public Member Functions

Constructors and Destructors
| List ()
| List (const List &new_list, bool)
void | destroy ()
virtual | ~List ()
Assignment
void | set (const List &list, bool=true)
const List & | operator= (const List &list)
void | get (List &list, bool deep=true) const
| Assign the content of a list to another.
void | swap (List &list)
| Swaps the contents of two lists.
Accessors
Size | getSize () const
bool | remove (const Value &item)
Predicates
bool | isEmpty () const
DatatypeMiscellaneous
virtual void | host (Visitor< List< Value > > &visitor)
Internal Iterators
bool | apply (UnaryProcessor< Value > &processor)
bool | operator== (const List< Value > &list) const
bool | operator!= (const List< Value > &list) const

## Detailed Description

template<typename Value>
class BALL::List< Value >

Extended list object. This object is an improved version of the STL list class

Definition at line 34 of file list.h.

## Member Typedef Documentation

## const_iterator

template<typename Value>

typedef std::list<Value>::const_iterator BALL::List< Value >::const_iterator

Definition at line 53 of file list.h.

## ConstIterator

template<typename Value>

typedef std::list<Value>::const_iterator BALL::List< Value >::ConstIterator

Constant iterator type.

Definition at line 51 of file list.h.

## Iterator

template<typename Value>

typedef std::list<Value>::iterator BALL::List< Value >::Iterator

Iterator type.

Definition at line 45 of file list.h.

## iterator

template<typename Value>

typedef std::list<Value>::iterator BALL::List< Value >::iterator

Definition at line 47 of file list.h.

## Constructor & Destructor Documentation

## List() [1/2]

template<typename Value>

BALL::List< Value >::List | ( |  | ) |

inline

Default constructor. Create an empty list.

Definition at line 64 of file list.h.

## List() [2/2]

template<typename Value>

BALL::List< Value >::List | ( | const List< Value > & | new_list,
|  | bool | )

inline

Copy constructor. Create a copy of an existing list.

Parameters

  map | the list to be copied
  deep | ignored

Definition at line 74 of file list.h.

## ~List()

template<typename Value>

virtual BALL::List< Value >::~List | ( |  | ) |

inline virtual

Destructor

Definition at line 88 of file list.h.

## Member Function Documentation

## apply()

template<typename Value>

bool BALL::List< Value >::apply | ( | UnaryProcessor< Value > & | processor | ) |

inline

Processor application method. Applies the processor to each entry of the list.

Parameters

  processor | the processor to be applied

Definition at line 194 of file list.h.

## destroy()

template<typename Value>

void BALL::List< Value >::destroy | ( |  | ) |

inline

Clear the list

Definition at line 81 of file list.h.

## get()

template<typename Value>

void BALL::List< Value >::get | ( | List< Value > & | list,
|  | bool | deep = true ) const

inline

Assign the content of a list to another.

Definition at line 121 of file list.h.

## getSize()

template<typename Value>

Size BALL::List< Value >::getSize | ( |  | ) | const

inline

Return the size of the list.

Definition at line 141 of file list.h.

## host()

template<typename Value>

void BALL::List< Value >::host | ( | Visitor< List< Value > > & | visitor | ) |

virtual

Visitor host method. Lists may be visited.

Parameters

  visitor | the visitor

Definition at line 247 of file list.h.

## isEmpty()

template<typename Value>

bool BALL::List< Value >::isEmpty | ( |  | ) | const

inline

Return true if the list is empty. This method return true if the list does not contain any entries.

Definition at line 171 of file list.h.

## operator!=()

template<typename Value>

bool BALL::List< Value >::operator!= | ( | const List< Value > & | list | ) | const

inline

Inequality operator. Test if two instances differ in at least one element.

Definition at line 239 of file list.h.

## operator=()

template<typename Value>

const List & BALL::List< Value >::operator= | ( | const List< Value > & | list | ) |

inline

Assign a list from another.

Definition at line 114 of file list.h.

## operator==()

template<typename Value>

bool BALL::List< Value >::operator== | ( | const List< Value > & | list | ) | const

inline

Equality operator. Test if two instances have the same size and same items at the same positions.

Definition at line 215 of file list.h.

## remove()

template<typename Value>

bool BALL::List< Value >::remove | ( | const Value & | item | ) |

inline

Remove an item from the list. The first item that matches item will be removed.

Parameters

  item | the item to be removed

Returns
  bool true if the item was removed

Definition at line 150 of file list.h.

## set()

template<typename Value>

void BALL::List< Value >::set | ( | const List< Value > & | list,
|  | bool | = true )

inline

Assign a list from another.

Parameters

  list | the map to be copied
  deep | ignored

Definition at line 101 of file list.h.

## swap()

template<typename Value>

void BALL::List< Value >::swap | ( | List< Value > & | list | ) |

inline

Swaps the contents of two lists.

Definition at line 127 of file list.h.