Aleph-w  1.9
General library for algorithms and data structures
Aleph::DynList< T > Class Template Reference

#include <htlist.H>

+ Inheritance diagram for Aleph::DynList< T >:
+ Collaboration diagram for Aleph::DynList< T >:

Classes

class  Iterator
 

Public Types

using Item_Type = T
 The type of item.
 
using Key_Type = T
 The type of item.
 
using iterator = StlIterator< SetName >
 
using const_iterator = StlConstIterator< SetName >
 

Public Member Functions

DynListswap (DynList &l) noexcept
 
 DynList () noexcept(std::is_nothrow_constructible< T >::value)
 Initialize an empty list.
 
 DynList (const DynList &l)
 
T & insert (const T &item)
 
T & insert (T &&item)
 
T & push (const T &item)
 
T & push (T &&item)
 
T & put (const T &item) noexcept(noexcept(T(item)))
 
T & put (T &&item) noexcept(noexcept(std::forward< T >(item)))
 
T & append (const T &item)
 
T & append (T &&item)
 
remove_ne () noexcept
 
remove ()
 
remove_first_ne () noexcept
 
remove_first ()
 
pop ()
 
get ()
 
T & get_last_ne () const noexcept
 
T & get_first_ne () const noexcept
 
T & get_last () const
 
T & get_first () const
 
T & top () const
 
void empty () noexcept
 empty the list
 
DynListreverse () noexcept
 
DynListrev () noexcept
 
DynList reverse () const
 
DynList rev () const
 
template<class Equal = std::equal_to<T>>
remove_ne (Equal eq) noexcept
 
template<class Equal = std::equal_to<T>>
remove (Equal eq)
 
 DynList (DynList &&l) noexcept
 
DynListoperator= (const DynList &l)
 
DynListoperator= (DynList &&l) noexcept
 
DynListappend (DynList &&list) noexcept
 
DynListinsert (DynList &&list) noexcept
 
DynListappend (const DynList &list) noexcept(noexcept(DynList(list)))
 
DynListinsert (const DynList &list) noexcept(noexcept(DynList(list)))
 
T & get (const size_t &i)
 
T & operator[] (const size_t &i)
 
void reset ()
 
bool is_empty () const noexcept
 
bool is_unitarian () const noexcept
 
bool is_unitarian_or_empty () const noexcept
 
Slinkncget_head () const noexcept
 
Slinkncget_tail () const noexcept
 
HTListswap (HTList &l) noexcept
 Swap in constant time (very fast) 'this' elements with 'l' list elements
Referenced by append(), insert(), reverse() and split_list(). More...
 
void insert (Slinknc *link) noexcept
 
void insert (HTList &l) noexcept
 
void insert (Slinknc *link, HTList &list) noexcept
 
void append (Slinknc *link) noexcept
 
void append (HTList &l) noexcept
 
void put (Slinknc *link) noexcept
 
void concat (HTList &l) noexcept
 
void concat_list (HTList &l) noexcept
 
Slinkncremove_head_ne () noexcept
 
Slinkncremove_head ()
 
bool remove (Slinknc *link)
 
void push (Slinknc *link) noexcept
 
Slinknctop ()
 
size_t split_list (HTList &l, HTList &r) noexcept
 
size_t split_list_ne (HTList &l, HTList &r) noexcept
 
size_t split (HTList &l, HTList &r) noexcept
 
size_t reverse_list () noexcept
 
void cut (Slinknc *link, HTList &list) noexcept
 It makes reference to is_empty().
Referenced by cut_list(). More...
 
void cut_list (Slinknc *link, HTList &list) noexcept
 
void remove_all_and_delete () noexcept
 
size_t size () const noexcept
 
void rotate_left (size_t n)
 
bool traverse (Operation &operation) noexcept(noexcept(operation))
 
bool traverse (Operation &operation) const noexcept(noexcept(operation))
 
bool traverse (Operation &&operation) const noexcept(noexcept(operation))
 
bool traverse (Operation &&operation) noexcept(noexcept(operation))
 
auto get_it () const
 
auto get_it (size_t pos) const
 
auto get_itor () const
 
T & nth_ne (const size_t n) noexcept
 
const T & nth_ne (const size_t n) const noexcept
 
T & nth (const size_t n)
 
const T & nth (const size_t n) const
 
T * find_ptr (Operation &operation) noexcept(noexcept(operation))
 
const T * find_ptr (Operation &operation) const noexcept(noexcept(operation))
 
const T * find_ptr (Operation &&operation) const noexcept(noexcept(operation))
 
T * find_ptr (Operation &&operation) noexcept(noexcept(operation))
 
size_t find_index (Operation &operation) const noexcept(noexcept(operation))
 
size_t find_index (Operation &&operation) const noexcept(noexcept(operation))
 
std::tuple< bool, T > find_item (Operation &operation) noexcept(noexcept(operation))
 
std::tuple< bool, T > find_item (Operation &operation) const noexcept(noexcept(operation))
 
std::tuple< bool, T > find_item (Operation &&operation) noexcept(noexcept(operation))
 
std::tuple< bool, T > find_item (Operation &&operation) const noexcept(noexcept(operation))
 
void emplace (Args &&... args)
 
void emplace_end (Args &&... args)
 
void emplace_ins (Args &&... args)
 
size_t ninsert (Args ... args)
 
size_t nappend (Args ... args)
 
void for_each (Operation &operation) noexcept(noexcept(operation))
 
void for_each (Operation &operation) const noexcept(noexcept(operation))
 
void for_each (Operation &&operation) const noexcept(noexcept(operation))
 
void for_each (Operation &&operation) noexcept(noexcept(operation))
 
void each (Operation &operation) noexcept(noexcept(operation))
 
void each (Operation &operation) const noexcept(noexcept(operation))
 
void each (Operation &&operation) const noexcept(noexcept(operation))
 
void each (Operation &&operation) noexcept(noexcept(operation))
 
void each (size_t pos, size_t slice, Operation &operation) const
 
void each (size_t pos, size_t slice, Operation &&operation) const
 
void mutable_for_each (Operation &operation) noexcept(noexcept(operation))
 
void mutable_for_each (Operation &&operation) noexcept(noexcept(operation))
 
bool all (Operation &operation) const noexcept(noexcept(operation))
 
bool all (Operation &&operation) const noexcept(noexcept(operation))
 
bool exists (Operation &op) const noexcept(noexcept(op))
 
bool exists (Operation &&op) const noexcept(noexcept(op))
 
DynList< __T > maps (Operation &op) const
 
DynList< __T > maps (Operation &&op) const
 
DynList< __T > maps_if (Prop prop, Operation &op) const
 
DynList< __T > maps_if (Prop prop, Operation &&op) const
 
DynList< T > to_dynlist () const
 
__T foldl (const __T &init, Op &op) const noexcept(noexcept(op))
 
__T foldl (const __T &init, Op &&op=Op()) const noexcept(noexcept(op))
 
fold (const T &init, Operation &operation) const noexcept(noexcept(operation))
 
fold (const T &init, Operation &&operation) const noexcept(noexcept(operation))
 
DynList< T > filter (Operation &operation) const
 
DynList< T > filter (Operation &&operation) const
 
DynList< const T *> ptr_filter (Operation &operation) const
 
DynList< const T *> ptr_filter (Operation &&operation) const
 
DynList< std::tuple< T, size_t > > pfilter (Operation &operation) const
 
DynList< std::tuple< T, size_t > > pfilter (Operation &&operation) const
 
std::pair< DynList< T >, DynList< T > > partition (Operation &op) const
 
std::pair< DynList< T >, DynList< T > > partition (Operation &&op) const
 
std::pair< DynList< T >, DynList< T > > partition (size_t n) const
 
std::tuple< DynList< T >, DynList< T > > tpartition (Operation &op) const
 
std::tuple< DynList< T >, DynList< T > > tpartition (Operation &&op) const
 
size_t length () const noexcept
 
DynList< T > take (const size_t n) const
 
DynList< T > take (size_t i, size_t j, size_t step=1) const
 
DynList< T > drop (const size_t n) const
 
void mutable_drop (size_t n)
 
DynList< T > items () const
 
DynList< T > keys () const
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cbegin () noexcept
 
const_iterator cend () const noexcept
 
const_iterator cend () noexcept
 

Detailed Description

template<typename T = int>
class Aleph::DynList< T >

Sequence of items implemented with a single linked list.

DynList<T> models list of items of generic type T.

See also
Slinknc Snodenc DynDList
Author
Alejandro Mujica
Leandro Rabindranath León

Constructor & Destructor Documentation

◆ DynList() [1/2]

template<typename T = int>
Aleph::DynList< T >::DynList ( const DynList< T > &  l)
inline

Initialize a list with a copy of all the items of list l

◆ DynList() [2/2]

template<typename T = int>
Aleph::DynList< T >::DynList ( DynList< T > &&  l)
inlinenoexcept

Initialize the list with all the items of l moved to this.

This constructor copies (by moving) all the items of list l. Consequently, no copy is done and the construction takes $O(1)$.

Note
Since l is a rvalue reference, take care of that if you are interested in to avoid the copy. So, if you have a lvalue referencde to a list, use std::move(), upon your responsability, if and only if you are absolutely sure that the list will not be needed after.
Parameters
[in]la rvalue containing a entire list.

Member Function Documentation

◆ all() [1/2]

bool Aleph::FunctionalMethods< DynList< T > , T >::all ( Operation &  operation) const
inlinenoexceptinherited

Check if all the elements of container satisfy a condition.

all(operation) checks if for each element item of container operation(item) returns true.

This method has complexity $O(n)$ in average and worst case.

Parameters
[in]operationto be used as condition
Returns
true if all the elements satisfy the criteria: false otherwise.
Exceptions
anythingthat could throw operation

◆ all() [2/2]

bool Aleph::FunctionalMethods< DynList< T > , T >::all ( Operation &&  operation) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ append() [1/6]

void Aleph::HTList::append ( Slinknc link)
inlinenoexceptinherited

Insert link as last element

Parameters
[in]linkNew element that will be inserted
+ Here is the caller graph for this function:

◆ append() [2/6]

void Aleph::HTList::append ( HTList l)
inlinenoexceptinherited

Join 'this' with 'l' through list end

Parameters
[in]lList that will be inserted through list end
+ Here is the call graph for this function:

◆ append() [3/6]

template<typename T = int>
T& Aleph::DynList< T >::append ( const T &  item)
inline

Append a new item by copy.

Allocate memory for a new item, copy and append it at the end of the list.

Returns
a modifiable reference to the item in the list
Exceptions
<tt>bad_alloc</tt>if there is no enough memory
+ Here is the caller graph for this function:

◆ append() [4/6]

template<typename T = int>
T& Aleph::DynList< T >::append ( T &&  item)
inline

Append a new item by movement.

Allocate memory for a new item, move to its allocated place and append it at the end of the list.

Returns
a modifiable reference to the item in the list
Exceptions
<tt>bad_alloc</tt>if there is no enough memory

◆ append() [5/6]

template<typename T = int>
DynList& Aleph::DynList< T >::append ( DynList< T > &&  list)
inlinenoexcept

Append listat the end of this by movement.

append(l) (in this rvalue version), puts in constant time the items of l at the end of this. After calling l becomes empty.

Note
Since l is a rvalue reference, take care of that if you are interested in to avoid the copy. So, if you have a lvalue reference to a list, use std::move(), upon your responsability, if and only if you are absolutely sure that the list will not be needed after.
Parameters
[in]la rvalue reference to the list to be appended

◆ append() [6/6]

template<typename T = int>
DynList& Aleph::DynList< T >::append ( const DynList< T > &  list)
inlinenoexcept

Append to this a copy of list.

This version of append(l) traverses the items of l and appends them (copies) into this.

Parameters
[in]llist to be copied at the end
Exceptions
bad_allocif there is no enough memory

◆ concat()

void Aleph::HTList::concat ( HTList l)
inlinenoexceptinherited

Concat to 'this' all 'l' list; 'l' becomes empty

◆ concat_list()

void Aleph::HTList::concat_list ( HTList l)
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ cut()

void Aleph::HTList::cut ( Slinknc link,
HTList list 
)
inlinenoexceptinherited

It makes reference to is_empty().
Referenced by cut_list().

It cuts 'this' over 'link' element and it puts all remaining elements

Parameters
[in]linkElement where 'list' will be cut.
[in]listList that will be cut in link

◆ cut_list()

void Aleph::HTList::cut_list ( Slinknc link,
HTList list 
)
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ drop()

DynList<T> Aleph::FunctionalMethods< DynList< T > , T >::drop ( const size_t  n) const
inlineinherited

Drop the first n elements seen in the container during its traversal.

The complexity of this method is $O(N)$ where N always is the number of elements of container.

Returns
A DynList<T> having the remainder $N - n$ elements according to traversal order.
Exceptions
bad_allocif there is no enough memory or out_of_range if n is greater or equal than N (the number of elements in the container).

◆ each() [1/6]

void Aleph::FunctionalMethods< DynList< T > , T >::each ( Operation &  operation)
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ each() [2/6]

void Aleph::FunctionalMethods< DynList< T > , T >::each ( Operation &  operation) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ each() [3/6]

void Aleph::FunctionalMethods< DynList< T > , T >::each ( Operation &&  operation) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ each() [4/6]

void Aleph::FunctionalMethods< DynList< T > , T >::each ( Operation &&  operation)
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ each() [5/6]

void Aleph::FunctionalMethods< DynList< T > , T >::each ( size_t  pos,
size_t  slice,
Operation &  operation 
) const
inlineinherited

Traverse all the container and performs a mutable operation on each element.

mutable_for_each(operation) traverses the container and on each element item is performed operation(item).

operation could have the following signature:

void operation(T & item)

Be very careful with the fact that this method allows to modify the elements themselves, what could badly alter the internal state of container. This would be the case for heaps, binary trees and hash tables.

Parameters
[in]<tt>operation</tt>to be done on each element.
Returns
an reference to this
Exceptions
anythingthat can throw operation

◆ each() [6/6]

void Aleph::FunctionalMethods< DynList< T > , T >::each ( size_t  pos,
size_t  slice,
Operation &&  operation 
) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ emplace()

void Aleph::FunctionalMethods< DynList< T > , T >::emplace ( Args &&...  args)
inlineinherited

Appends a new element into the container by constructing it in-place with the given args.

emplace(args) tries to match a constructor T(args). If this exists, then this is constructed in-place and directly forwarded to the method append() of container. If all on the container and T` is adequately done, then the object is constructed once time, successively forwarded and at its target place in the container is moved, avoiding thus unnecessary copies.

Note
The semantic of append depends of container. In general, this has some sense for lists and arrays and it means insertion at the end of sequence. On other type of container append() is equivalent to insert().
Parameters
[in]argsvariadic arguments list
Exceptions
bad_allocif there is no enough memory

◆ emplace_end()

void Aleph::FunctionalMethods< DynList< T > , T >::emplace_end ( Args &&...  args)
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ emplace_ins()

void Aleph::FunctionalMethods< DynList< T > , T >::emplace_ins ( Args &&...  args)
inlineinherited

Insert a new element into the container by constructing it in-place with the given args.

emplace_ins(args) tries to match a constructor T(args). If this exists, then this is constructed in-place and directly forwarded to the method insert() of container. If all on the container and T` is adequately done, then the object is constructed once time, successively forwarded and finally, at its target place in the container, is moved, avoiding thus unnecessary copies.

Note
The semantic of insert() depends of container. In general, this has some sense for lists and arrays and it means insertion at the beginning of sequence. On other type of container append() is equivalent to insert().
Parameters
[in]argsvariadic arguments list
Exceptions
bad_allocif there is no enough memory

◆ exists() [1/2]

bool Aleph::FunctionalMethods< DynList< T > , T >::exists ( Operation &  op) const
inlinenoexceptinherited

Test for existence in the container of an element satisfying a criteria.

exists(op) returns true if it exists any element item in container for which op(item) return true.

This method has complexity $O(n)$ in average and worst case.

Parameters
[in]opoperation for testing existence
Returns
true if it exists an item for which op return true; false otherwise.
Exceptions
anythingthat could throw op

◆ exists() [2/2]

bool Aleph::FunctionalMethods< DynList< T > , T >::exists ( Operation &&  op) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ filter() [1/2]

DynList<T> Aleph::FunctionalMethods< DynList< T > , T >::filter ( Operation &  operation) const
inlineinherited

Filter the elements of a container according to a matching criteria.

This method builds a dynamic list with copies of items of container matching a criteria defined by operation, which should have the following signature:

bool operation(const T & item)

If operation return true then item matches the criteria; otherwise, operation must return false.

For example, if the container has integer, the the following code snippet would return a list containing the items greater than 100:

c.filter([] (auto item) { return item > 100; });
Parameters
[in]operationdefining the flter criteria
Returns
a DynList<T> with the matched elements.
Exceptions
anythingthat could throw operation or bad_alloc if there is no enough memory

◆ filter() [2/2]

DynList<T> Aleph::FunctionalMethods< DynList< T > , T >::filter ( Operation &&  operation) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ find_index() [1/2]

size_t Aleph::LocateFunctions< DynList< T > , T >::find_index ( Operation &  operation) const
inlinenoexceptinherited

Find the position of an item in the container according to a searching criteria.

find_index(operation) traverses the container and on each item perform operation(item). If the result of operation is true, then the traversal is stopped and the position of the current item (which mathes operation) is returned.

operation must have the following signature:

bool operation(const typename Container::Item_Type & item)
Warning
Frequent use of this method will definitively degrade the performance. Try not to use this method inside loops. In general, if you falls in this situation, the consider your design and use a faster approach.
Parameters
[in]<tt>operation</tt>to be performed on each item for matching a searching criteria.
Returns
the last seen position. If the item is not found, then the number of items is returned.

◆ find_index() [2/2]

size_t Aleph::LocateFunctions< DynList< T > , T >::find_index ( Operation &&  operation) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ find_item() [1/4]

std::tuple<bool, T > Aleph::LocateFunctions< DynList< T > , T >::find_item ( Operation &  operation)
inlinenoexceptinherited

Safe sequential searching of an item matching a criteria.

find_item(operation) traverses the container and on each item perform operation(item). If the result of operation is true, then the traversal is stopped and duple containg a copy of found item is returned.

The method is said safe because returns a copy of item.

operation must have the following signature:

bool operation(const typename Container::Item_Type & item)
Parameters
[in]<tt>operation</tt>to be used as searching criteria
Returns
a duple tuple<bool, Type>. The first field indicates if the item was found and the second contains a copy of found item. If no item is found, then the first field is false and the second is the result of default constructor on the type stored in the container.

◆ find_item() [2/4]

std::tuple<bool, T > Aleph::LocateFunctions< DynList< T > , T >::find_item ( Operation &  operation) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ find_item() [3/4]

std::tuple<bool, T > Aleph::LocateFunctions< DynList< T > , T >::find_item ( Operation &&  operation)
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ find_item() [4/4]

std::tuple<bool, T > Aleph::LocateFunctions< DynList< T > , T >::find_item ( Operation &&  operation) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ find_ptr() [1/4]

T * Aleph::LocateFunctions< DynList< T > , T >::find_ptr ( Operation &  operation)
inlinenoexceptinherited

Find a pointer to an item in the container according to a searching criteria.

find_ptr(operation) traverses the container and on each item perform operation(item). If the result of operation is true, then the traversal is stopped and a pointer to the current item (which mathes operation) is returned.

operation must have the following signature:

bool operation(const typename Container::Item_Type & item)
Warning
Frequent use of this method will definitively degrade the performance. Try not to use this method inside loops. In general, if you falls in thie situation, the consider your design and to use an faster approach.
Parameters
[in]<tt>operation</tt>to be performed on each item for matching a searching criteria.
Returns
a valid pointer to an item if this was found or nullptr otherwise.

◆ find_ptr() [2/4]

const T * Aleph::LocateFunctions< DynList< T > , T >::find_ptr ( Operation &  operation) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ find_ptr() [3/4]

const T * Aleph::LocateFunctions< DynList< T > , T >::find_ptr ( Operation &&  operation) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ find_ptr() [4/4]

T * Aleph::LocateFunctions< DynList< T > , T >::find_ptr ( Operation &&  operation)
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ fold() [1/2]

T Aleph::FunctionalMethods< DynList< T > , T >::fold ( const T &  init,
Operation &  operation 
) const
inlinenoexceptinherited

Simplified version of foldl() where the folded type is the same type of elements stored in the container.

See also
foldl(const __T & init, Op & op)

◆ fold() [2/2]

T Aleph::FunctionalMethods< DynList< T > , T >::fold ( const T &  init,
Operation &&  operation 
) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ foldl() [1/2]

__T Aleph::FunctionalMethods< DynList< T > , T >::foldl ( const __T &  init,
Op &  op 
) const
inlinenoexceptinherited

Fold the elements of the container to a specific result.

foldl(init, op) set an internal variable acc of type __T to init value. Then it traverses the container and on each item it performs:

acc = op(acc, op(acc, item);

So acc serves as a sort of accumulator.

op should have the following signature:

__T op(__T acc, const T & item);

Since foldl is overloaded with several operation structures, there is a certain flexibility with the parameter qualifiers. You could, for example, to declare acc and/or item by value.

The method is a template. The first template parameter __T specifies the final folded type. By default, this type is T (the type of elements stored in the container). The second parameter is the operation. If the folded type is the same than T (the type of item stored), the you can simply write a foldl(). For example, if the container stores integer, in order to determine the maximum of all elements you could do:

c.foldl(std::numeric_limits<int>::min(), [] (int acc, int item)
  {
    return std::min(acc, item);
  });

When the folded type is different than T, then you must specify the folded type as template parameter. For example, if you want to compute the sum of inversed elements, the you could do it as follows:

c.template foldl<double>(0, [] (double acc, int item)
  {
    return acu + 1.0/item;
  });
Parameters
[in]initinitial value of folded value (or accumulator).
[in]opoperation to be performed on each item and used for folding.
Returns
the final folded computation.
Exceptions
anythingthat could throw op

◆ foldl() [2/2]

__T Aleph::FunctionalMethods< DynList< T > , T >::foldl ( const __T &  init,
Op &&  op = Op() 
) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ for_each() [1/4]

void Aleph::FunctionalMethods< DynList< T > , T >::for_each ( Operation &  operation)
inlinenoexceptinherited

Traverse all the container and performs an operation on each element.

for_each(operation) traverses the container and on each element item is performed operation(item).

operation must have the following signature:

void operation(const T & item)

Overloadings of this method allow that that the signature can be lightly different; for example, remove the reference or the const.

Parameters
[in]<tt>operation</tt>to be done on each element.
Returns
an reference to this
Exceptions
anythingthat can throw operation

◆ for_each() [2/4]

void Aleph::FunctionalMethods< DynList< T > , T >::for_each ( Operation &  operation) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ for_each() [3/4]

void Aleph::FunctionalMethods< DynList< T > , T >::for_each ( Operation &&  operation) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ for_each() [4/4]

void Aleph::FunctionalMethods< DynList< T > , T >::for_each ( Operation &&  operation)
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ get() [1/2]

template<typename T = int>
T Aleph::DynList< T >::get ( )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ get() [2/2]

template<typename T = int>
T& Aleph::DynList< T >::get ( const size_t &  i)
inline

Obtains a modifiable reference to the i-th item of this. Throws overflow_error if i is greater or equal to number of elements

◆ get_first()

template<typename T = int>
T& Aleph::DynList< T >::get_first ( ) const
inline

Return the first item of the list

Returns
a modifiable reference to the first item
Exceptions
underflow_errorif the list is empty
+ Here is the caller graph for this function:

◆ get_first_ne()

template<typename T = int>
T& Aleph::DynList< T >::get_first_ne ( ) const
inlinenoexcept

Return the first item of the list without exception

Returns
a modifiable reference to the first item

◆ get_head()

Slinknc* Aleph::HTList::get_head ( ) const
inlinenoexceptinherited

Return list head (first element)

◆ get_it() [1/2]

auto Aleph::LocateFunctions< DynList< T > , T >::get_it ( ) const
inlineinherited

Return an properly initialized iterator positioned at the first item on the container

◆ get_it() [2/2]

auto Aleph::LocateFunctions< DynList< T > , T >::get_it ( size_t  pos) const
inlineinherited

Return an properly initialized iterator positioned at the pos item on the container

◆ get_itor()

auto Aleph::LocateFunctions< DynList< T > , T >::get_itor ( ) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ get_last()

template<typename T = int>
T& Aleph::DynList< T >::get_last ( ) const
inline

Return the last item of the list

Returns
a modifiable reference to the last item
Exceptions
underflow_errorif the list is empty
+ Here is the caller graph for this function:

◆ get_last_ne()

template<typename T = int>
T& Aleph::DynList< T >::get_last_ne ( ) const
inlinenoexcept

Return the last item of the list without exception.

Returns
a modifiable reference to the last item

◆ get_tail()

Slinknc* Aleph::HTList::get_tail ( ) const
inlinenoexceptinherited

Return list tail (first element)

◆ insert() [1/7]

void Aleph::HTList::insert ( Slinknc link)
inlinenoexceptinherited

Insert link as first element

Parameters
[in]linkNew element that will be inserted
+ Here is the caller graph for this function:

◆ insert() [2/7]

void Aleph::HTList::insert ( HTList l)
inlinenoexceptinherited

Insert starting in link (contained in 'this' list) the 'list' list. 'list' becomes empty

Parameters
[in]linkElement where 'list' will start
[in]listList that will be inserted after link

◆ insert() [3/7]

void Aleph::HTList::insert ( Slinknc link,
HTList list 
)
inlinenoexceptinherited

Insert a list into this after one of its items.

insert(link, list) assumes that link points to a item of this and inserts in constant time list just after the item pointed by link. The order of list is not altered. but list becomes empty after insertion.

Suppose the following situation

this-->t1-->t2-->t3-->t4-->t5-->t6-->t7-->t8
                ^

| link

l–>l1–>l2–>l3–>l4

Then insert(link, list) produces:

this-->t1-->t2-->t3-->t4-->l1-->l2-->l3-->l4-->t5-->t6-->t7-->t8

l becomes empty

Parameters
[in]linkto the item after one wants to insert list
[in]listto be inserted after item pointed by link

◆ insert() [4/7]

template<typename T = int>
T& Aleph::DynList< T >::insert ( const T &  item)
inline

Insert a new item by copy.

Allocate memory for a new item, copy and insert into the list as the first item.

Returns
a modifiable reference to the item in the list
Exceptions
<tt>bad_alloc</tt>if there is no enough memory
+ Here is the caller graph for this function:

◆ insert() [5/7]

template<typename T = int>
T& Aleph::DynList< T >::insert ( T &&  item)
inline

Insert a new item by movement.

Allocate memory for a new item, move the item and insert into the list as the first item. This operation can be faster that the equivalent with copy

Returns
a modifiable reference to the item in the list
Exceptions
<tt>bad_alloc</tt>if there is no enough memory

◆ insert() [6/7]

template<typename T = int>
DynList& Aleph::DynList< T >::insert ( DynList< T > &&  list)
inlinenoexcept

Insert listat the beginning of this by movement.

insert(l) (in this rvalue version), puts in constant time the items of l at the beggining of this. After calling l becomes empty.

Note
Since l is a rvalue reference, take care of that if you are interested in to avoid the copy. So, if you have a lvalue reference to a list, use std::move(), upon your responsability, if and only if you are absolutely sure that the list will not be needed after.
Parameters
[in]la rvalue reference to the list to be inserted

◆ insert() [7/7]

template<typename T = int>
DynList& Aleph::DynList< T >::insert ( const DynList< T > &  list)
inlinenoexcept

Insert to this a copy of list.

This version of insert(l) traverses the items of l and insert a copy into this.

Parameters
[in]llist to be copied at the end
Exceptions
bad_allocif there is no enough memory

◆ is_empty()

bool Aleph::HTList::is_empty ( ) const
inlinenoexceptinherited

Return true if list is empty

+ Here is the caller graph for this function:

◆ is_unitarian()

bool Aleph::HTList::is_unitarian ( ) const
inlinenoexceptinherited

Return true if the list contains exactly just one element

◆ is_unitarian_or_empty()

bool Aleph::HTList::is_unitarian_or_empty ( ) const
inlinenoexceptinherited

Return true if list contains one element or is empty

◆ items()

DynList<T> Aleph::GenericItems< DynList< T > , T >::items ( ) const
inlineinherited

Return a list of all the elements of a container sorted by traversal order.

Returns
a DynList<T> containing all the elements of the container
Exceptions
bad_allocif there is no enough memory

◆ keys()

DynList<T> Aleph::GenericItems< DynList< T > , T >::keys ( ) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ length()

size_t Aleph::FunctionalMethods< DynList< T > , T >::length ( ) const
inlinenoexceptinherited

Count the number of elements of a container.

This method counts the number of elements stored in the container.

Note
Take in account that this method computes; it does not retrieve. Consequently it always takes $O(n)$. However, for many containers this number is already stored and retrievable in $O(1)$ through the methos size()
Returns
the number of elements stored in the container.

◆ maps() [1/2]

DynList<__T> Aleph::FunctionalMethods< DynList< T > , T >::maps ( Operation &  op) const
inlineinherited

Map the elements of the container.

maps(op) produces a dynamic list resulting of mapping of each element of container item to the result of operation op(item).

maps() is a template method which receives as template parameters the type __T, which is the type of target or range of mapping, and the transforming operation. By default __T is the same type of the elements stored in the container.

operation should have the following signature:

__T operation(const T & item)

So, operation(item) performs a transformation of item towards the type __T.

If __T ==T`, which is common and by default, then you could specify a mapping without need of template specification. For example, if the container has integer values, the a mapping of item multiplied by 4 could be very simply written as follows:

c.maps([] (int item) { return 4*i; });

In contrast, if the range type is different than the domain type, then it is necessary to specify the template keyword in the method call. For example, if the range is double and you want to return the elements divided by 4, the could do as follows:

c.template maps<double>([] (int item) { return 1.0*item/4; });
Parameters
[in]opoperation to be performed in order to do the transformation on an item
Returns
a `DynList<__T> object containing the mapped items. The order of resulting list is the same than the order of visit of the iterator for the container.
Exceptions
anythingthat could throw op or bad_alloc if there is no enough memory

◆ maps() [2/2]

DynList<__T> Aleph::FunctionalMethods< DynList< T > , T >::maps ( Operation &&  op) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ maps_if() [1/2]

DynList<__T> Aleph::FunctionalMethods< DynList< T > , T >::maps_if ( Prop  prop,
Operation &  op 
) const
inlineinherited

Conditional mapping of the elements of the container.

maps_if(prop, op) traverses each item of container, on each item it tests the proposition prop. If this last is true, then the item is mapped through the function op(item).

Parameters
[in]opoperation to be perfomed in order to do the transformation on an item.
[in]propa lambda returning a bool which perform the logical test.
Returns
a `DynList<__T> object containing the mapped items. The order of resulting list is the same than the order of visit of the iterator for the container.
Exceptions
anythingthat could throw op or bad_alloc if there is no enough memory

◆ maps_if() [2/2]

DynList<__T> Aleph::FunctionalMethods< DynList< T > , T >::maps_if ( Prop  prop,
Operation &&  op 
) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ mutable_drop()

void Aleph::FunctionalMethods< DynList< T > , T >::mutable_drop ( size_t  n)
inlineinherited

Drop the first n elements seen from container.

The complexity of this method is $O(N)$ where N always is the number of elements of container.

Exceptions
out_of_rangeif n is greater or equal than N (the number of elements in the container).

◆ mutable_for_each()

void Aleph::FunctionalMethods< DynList< T > , T >::mutable_for_each ( Operation &&  operation)
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ nappend()

size_t Aleph::FunctionalMethods< DynList< T > , T >::nappend ( Args ...  args)
inlineinherited

Append n variadic items

Parameters
[in]argsitems to be appended
Returns
the number of appended items

◆ ninsert()

size_t Aleph::FunctionalMethods< DynList< T > , T >::ninsert ( Args ...  args)
inlineinherited

Insert n variadic items

Parameters
[in]argsitems to be inserted
Returns
the number of inserted items

◆ nth() [1/2]

T & Aleph::LocateFunctions< DynList< T > , T >::nth ( const size_t  n)
inlineinherited

Return the n-th item of container.

The notion of ordinal depends of type of container. On list, probably will be the insertion order. On binary search trees will be the nth smaller item. On hash tables will be pseudo random.

Warning
Frequent use of this method will definitively degrade the performance. Try not to use this method inside loops. In general, if you falls in this situation, then consider your design and to use an faster approach.
Parameters
[in]nthe nth item to find
Returns
a valid reference to the item into the container.
Exceptions
out_of_rangeif n is greater or equal that the size of container.

◆ nth() [2/2]

const T & Aleph::LocateFunctions< DynList< T > , T >::nth ( const size_t  n) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ nth_ne()

const T & Aleph::LocateFunctions< DynList< T > , T >::nth_ne ( const size_t  n) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator=() [1/2]

template<typename T = int>
DynList& Aleph::DynList< T >::operator= ( const DynList< T > &  l)
inline

Assign to this a copy of l

First, the list is emptied (all its elements are deleted). Then sequential copy of each item of l is inserted into this.

This assignation takes $O(|l|)$ in complexity.

Parameters
[in]llist whose items want to be inserted into this
Exceptions
<tt>bad_alloc</tt>if there is no enough memory

◆ operator=() [2/2]

template<typename T = int>
DynList& Aleph::DynList< T >::operator= ( DynList< T > &&  l)
inlinenoexcept

Assign to this by movement the list l

This assignation swaps the content of this with the content of l. This swapping is done in $O(1)$.

Note
Since l is a rvalue reference, take care of that if you are interested in to avoid the copy. So, if you have a lvalue referencde to a list, use std::move(), upon your responsability, if and only if you are absolutely sure that the list will not be needed after.
Parameters
[in]la rvalue reference to the list to be assigned by movement.

◆ operator[]()

template<typename T = int>
T& Aleph::DynList< T >::operator[] ( const size_t &  i)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ partition() [1/3]

std::pair<DynList<T>, DynList<T> > Aleph::FunctionalMethods< DynList< T > , T >::partition ( Operation &  op) const
inlineinherited

Exclusive partition of container according to a filter criteria.

partition(op) traverses the container and filters its elements according to the filter criteria defined by op. The filtered elements are copied to a first list and the not filtered ones to a second list. When all the container is traversed, a pair containing these lists is returned.

The op requirements are the same than for filter().

Parameters
[in]opoperation instrumenting the filter criteria
Returns
a std::pair<DynList<T>, DynList<T>>.firstcontains the filtered elements andsecondthe non-filtered ones. \throw anything that could throw op orbad_alloc` if there is no enough memory
See also
filter()

◆ partition() [2/3]

std::pair<DynList<T>, DynList<T> > Aleph::FunctionalMethods< DynList< T > , T >::partition ( Operation &&  op) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ partition() [3/3]

std::pair<DynList<T>, DynList<T> > Aleph::FunctionalMethods< DynList< T > , T >::partition ( size_t  n) const
inlineinherited

Exclusive partition of container in the nth item

partition(n) traverses the container and produces a pair of lists. The first one contains the first n elements and the second one the this->size() - n remaining elements.

Parameters
[in]nthe first n items of the first list
Exceptions
anythingthat could throw op or bad_alloc if there is no enough memory

◆ pfilter() [1/2]

DynList<std::tuple<T, size_t> > Aleph::FunctionalMethods< DynList< T > , T >::pfilter ( Operation &  operation) const
inlineinherited

Filter the elements of a container according to a matching criteria and determine its positions respect to the traversal of container.

pfilter(operation) is very similar to filter(), but instead of building a list of filtered elements, it builds a list of pairs with form (item, pos), where item is a copy of filtered element and pos is its position respect to the traversal order. The position is relative to the container type.

The pair is defined with a tuple:

std::tuple<T, size_t>
Parameters
[in]operationthat defines the filter criteria
Returns
a DynList
Exceptions
bad_allocif there is no enough memory
See also
filter(Operation & operation)

◆ pfilter() [2/2]

DynList<std::tuple<T, size_t> > Aleph::FunctionalMethods< DynList< T > , T >::pfilter ( Operation &&  operation) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ pop()

template<typename T = int>
T Aleph::DynList< T >::pop ( )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ ptr_filter()

DynList<const T*> Aleph::FunctionalMethods< DynList< T > , T >::ptr_filter ( Operation &  operation) const
inlineinherited

Filter the elements of a container according to a matching criteria an return pointer to the matched items in the container.

This method builds a dynamic list with stores pointers to the items of matching a criteria defined by operation, which should have the followgin signature:

bool operation(const T & item)

If operation return true then item matches the criteria; otherwise, operation must return false.

For example, if the container has integer, the the following code snippet would return a list containing the items greater than 100:

c.ptr_filter([] (auto item) { return item > 100; });
Parameters
[in]operationdefining the flter criteria
Returns
a DynList<const T*> with the pointers to the matched elements.
Exceptions
anythingthat could throw operation or bad_alloc if there is no enough memory

◆ push() [1/3]

void Aleph::HTList::push ( Slinknc link)
inlinenoexceptinherited

Insert link as first element

+ Here is the call graph for this function:

◆ push() [2/3]

template<typename T = int>
T& Aleph::DynList< T >::push ( const T &  item)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

+ Here is the caller graph for this function:

◆ push() [3/3]

template<typename T = int>
T& Aleph::DynList< T >::push ( T &&  item)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ put() [1/3]

void Aleph::HTList::put ( Slinknc link)
inlinenoexceptinherited

Insert link as last element

◆ put() [2/3]

template<typename T = int>
T& Aleph::DynList< T >::put ( const T &  item)
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ put() [3/3]

template<typename T = int>
T& Aleph::DynList< T >::put ( T &&  item)
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ remove() [1/3]

bool Aleph::HTList::remove ( Slinknc link)
inlineinherited

Remove from the list the item pointed by link

remove(link) perform a sequential traversal of this until find link. Then link is removed.

This method has a complexity of $O(n)$ for worst and average case.

Parameters
[in]linkpointer to the item to be removed.
Returns
true if link was found and removed: false otherwise
Exceptions
underflow_errorif the list is empty
+ Here is the call graph for this function:

◆ remove() [2/3]

template<typename T = int>
T Aleph::DynList< T >::remove ( )
inline

Remove the first item of the list.

Returns
a copy of removed item
Exceptions
underflow_errorif the list is empty

◆ remove() [3/3]

template<typename T = int>
template<class Equal = std::equal_to<T>>
T Aleph::DynList< T >::remove ( Equal  eq)
inline

Remove the first element matching an equality criteria.

remove(eq) sequentially traverses the list and on each current element curr it calls to eq(curr). If the test is true, then curr is removed from the list and a copy of ciirr is returned. Otherwise, if no element matches with eq() test, then exception domain_error is thrown.

The eq() must match the following signature:

bool eq(const T& op)

This test would return true when op satisfies the finding criteria`.

Since that this method is overloaded, you could define several flavors: a more sophisticated functor, function pointers or lambdas.

Parameters
[in]eqequality test
Returns
a copy of removed element if the item was found and removed; otherwise the exception domain_error is thrown.

◆ remove_all_and_delete()

void Aleph::HTList::remove_all_and_delete ( )
inlinenoexceptinherited

Remove and free memory for all the items of list.

remove_all_and_delete() remove each item of the list and call to delete operator on the removed item. At the end of call, all the items were removed, all the memory freed qand the list emptied.

Warning
This method only has sense if the items of list were dynamically allocated with new. Although That is very frequently the case, there are some exceptions. So, be sure that the items were allocated with new operator.
+ Here is the call graph for this function:

◆ remove_first()

template<typename T = int>
T Aleph::DynList< T >::remove_first ( )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

+ Here is the caller graph for this function:

◆ remove_first_ne()

template<typename T = int>
T Aleph::DynList< T >::remove_first_ne ( )
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ remove_head()

Aleph::HTList::remove_head ( )
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Remove the header item from the list.

Returns
a pointer to the removed item
Exceptions
underflow_errorif the list is empty

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Remove the first item of this.

This synonym is adequate when this is dealed as a stack.

Returns
a pointer to the removed item.
Exceptions
underflow_errorif the list is empty
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_head_ne()

Slinknc* Aleph::HTList::remove_head_ne ( )
inlinenoexceptinherited

It deletes head element (first one). Return deleted element

+ Here is the caller graph for this function:

◆ remove_ne()

template<typename T = int>
T Aleph::DynList< T >::remove_ne ( )
inlinenoexcept

Remove the first item of the list without exception.

Returns
a copy of removed item
Exceptions
underflow_errorif the list is empty

◆ reverse()

template<typename T = int>
DynList Aleph::DynList< T >::reverse ( ) const
inline

Return a reversed copy of this. Not confuse with reverse without const which mutates this

◆ reverse_list()

size_t Aleph::HTList::reverse_list ( )
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ rotate_left()

void Aleph::HTList::rotate_left ( size_t  n)
inlineinherited

Rotate to left the list n positions.

rotate_left(n) rotates the items to left n positions. For example, if the list is as follows:

l0, l1, l2, l3, l4, l5, l6, l7, l8, l9

Then rotate_left(4) produces the following state:

l4, l5, l6, l7, l8, l9, l0, l1, l2, l3
Parameters
[in]nthe number of position to be rotated
Exceptions
domain_errorif list is empty
+ Here is the call graph for this function:

◆ size()

size_t Aleph::HTList::size ( ) const
inlinenoexceptinherited

Count the number of elements of the list.

This method counts, it does not retrieve, the number of elements stored in the list.

So it is complexity is $O(n)$. This is some polemic because one could maintain an internal counter and retrieve it in constant time. It possible that this feauture is put in next versions. We do not maintain this counter because it is possible to add or remove items from a given node. So these operations would require access to the full list's context, what it often not the case.

Returns
the number of items of list
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ split()

size_t Aleph::HTList::split ( HTList l,
HTList r 
)
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ split_list()

size_t Aleph::HTList::split_list ( HTList l,
HTList r 
)
inlinenoexceptinherited

It divides 'this' into two equal lists without modifying elements order

Split the list in two.

This method takes the first n/2 items of `this` and puts them, in
the same order, in list `l`. The remainder items are put in list
`r`. After operation `this` becomes empty. The order of items is
preserved through `l` and `r`.

\param[out] l list containg the first n/2 first items
\param[out] r list containg the last n/2 first items
\return the total of items that has `this`
+ Here is the call graph for this function:

◆ swap() [1/2]

HTList& Aleph::HTList::swap ( HTList l)
inlinenoexceptinherited

Swap in constant time (very fast) 'this' elements with 'l' list elements
Referenced by append(), insert(), reverse() and split_list().

Exchange 'this' values with another list

Parameters
[in]lNew list which elements will be exchanged
+ Here is the caller graph for this function:

◆ swap() [2/2]

template<typename T = int>
DynList& Aleph::DynList< T >::swap ( DynList< T > &  l)
inlinenoexcept

Swap this with l. All items of each list are swapped in constant time

+ Here is the caller graph for this function:

◆ take() [1/2]

DynList<T> Aleph::FunctionalMethods< DynList< T > , T >::take ( const size_t  n) const
inlineinherited

Return a list with the first n elements seen in the container during its traversal.

The complexity of this method is $O(n)$ where n can be less than the number of elements of container.

Returns
A DynList<T> having the first n elements according to its traversal order.
Exceptions
bad_allocif there is no enough memory or out_of_range if n is greater or equal than the number of elements in the container.

◆ take() [2/2]

DynList<T> Aleph::FunctionalMethods< DynList< T > , T >::take ( size_t  i,
size_t  j,
size_t  step = 1 
) const
inlineinherited

Return a list with elements seen in the container between i and j position respect to its traversal.

The complexity of this method is $O(n)$ where n can be less than the number of elements of container.

Returns
A DynList<T> having the first n elements according to its traversal order.
Exceptions
bad_allocif there is no enough memory or out_of_range if n is greater or equal than the number of elements in the container.

◆ top()

template<typename T = int>
T& Aleph::DynList< T >::top ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ tpartition() [1/2]

std::tuple<DynList<T>, DynList<T> > Aleph::FunctionalMethods< DynList< T > , T >::tpartition ( Operation &  op) const
inlineinherited

Exclusive partition of container according to a filter criteria.

This methos has exactly the same semantic than partition(Operation & op), excepts than instead of returning a std::pair it returns a std::tuple.

Parameters
[in]opoperation instrumenting the filter criteria
Returns
a std::tuple<DynList<T>, DynList<T>>.firstcontains the filteres elements andsecondthe non-filtered ones. \throw anything that could throw op orbad_alloc` if there is no enough memory
See also
partition(Operation & op)

◆ tpartition() [2/2]

std::tuple<DynList<T>, DynList<T> > Aleph::FunctionalMethods< DynList< T > , T >::tpartition ( Operation &&  op) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ traverse() [1/4]

bool Aleph::GenericTraverse< DynList< T > >::traverse ( Operation &  operation)
inlinenoexceptinherited

Traverse the container via its iterator and performs a conditioned operation on each item.

traverse(operation) instantiates the internal iterator of the class and traverses each item performing operation(item).

operation must have the following signature:

bool operation(const typename Container::Item_Type & item)

If operation(item) returns true then the iterator is advanced and the next item processed. Otherwise. the traversal stops.

Parameters
[in]operationto be performed on each item
Returns
true if all the items were visited (operation on each one always returned true) or false if the traversal was stoppep because there was a false result on an item.
Exceptions
anythingthat could throw operation

◆ traverse() [2/4]

bool Aleph::GenericTraverse< DynList< T > >::traverse ( Operation &  operation) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ traverse() [3/4]

bool Aleph::GenericTraverse< DynList< T > >::traverse ( Operation &&  operation) const
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ traverse() [4/4]

bool Aleph::GenericTraverse< DynList< T > >::traverse ( Operation &&  operation)
inlinenoexceptinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


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

Leandro Rabindranath León