OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

SortableList< T > Class Template Reference

A list that is sorted upon construction or when explicitly requested with the sort() method. More...

Inheritance diagram for SortableList< T >:
Collaboration diagram for SortableList< T >:

List of all members.


Public Member Functions

 SortableList ()
 Null constructor, sort later (eg, after assignment or transfer).
 SortableList (const UList< T > &)
 Construct from UList, sorting immediately.
 SortableList (const Xfer< List< T > > &)
 Construct from transferred List, sorting immediately.
 SortableList (const label size)
 Construct given size. Sort later on.
 SortableList (const label size, const T &)
 Construct given size and initial value. Sort later on.
 SortableList (const SortableList< T > &)
 Construct as copy.
const labelListindices () const
 Return the list of sorted indices. Updated every sort.
labelListindices ()
 Return non-const access to the sorted indices. Updated every sort.
void clear ()
 Clear the list and the indices.
List< T > & shrink ()
 Clear the indices and return a reference to the underlying List.
void sort ()
 (stable) sort the list (if changed after construction time)
void reverseSort ()
 Reverse (stable) sort the list.
Xfer< List< T > > xfer ()
 Transfer contents to the Xfer container as a plain List.
void operator= (const T &)
 Assignment of all entries to the given value.
void operator= (const UList< T > &)
 Assignment from UList operator. Takes linear time.
void operator= (const SortableList< T > &)
 Assignment operator. Takes linear time.

Detailed Description

template<class T>
class Foam::SortableList< T >

A list that is sorted upon construction or when explicitly requested with the sort() method.

Uses the Foam::stableSort() algorithm.

Source files

Definition at line 48 of file SortableList.H.


Constructor & Destructor Documentation

SortableList (  )  [inline]

Null constructor, sort later (eg, after assignment or transfer).

Definition at line 42 of file SortableList.C.

SortableList ( const UList< T > &  values  )  [inline, explicit]

Construct from UList, sorting immediately.

Definition at line 47 of file SortableList.C.

SortableList ( const Xfer< List< T > > &  values  )  [inline, explicit]

Construct from transferred List, sorting immediately.

Definition at line 56 of file SortableList.C.

References SortableList< T >::sort().

Here is the call graph for this function:

SortableList ( const label  size  )  [inline, explicit]

Construct given size. Sort later on.

The indices remain empty until the list is sorted

Definition at line 65 of file SortableList.C.

References SortableList< T >::sort().

Here is the call graph for this function:

SortableList ( const label  size,
const T &  val 
) [inline]

Construct given size and initial value. Sort later on.

The indices remain empty until the list is sorted

Definition at line 72 of file SortableList.C.

SortableList ( const SortableList< T > &  lst  )  [inline]

Construct as copy.

Definition at line 79 of file SortableList.C.


Member Function Documentation

const labelList& indices (  )  const [inline]

Return the list of sorted indices. Updated every sort.

Definition at line 92 of file SortableList.H.

Referenced by primitiveMesh::checkPointNearness(), Foam::matchPoints(), Foam::mergePoints(), and PatchTools::sortedEdgeFaces().

Here is the caller graph for this function:

labelList& indices (  )  [inline]

Return non-const access to the sorted indices. Updated every sort.

Definition at line 98 of file SortableList.H.

void clear (  )  [inline]

Clear the list and the indices.

Reimplemented from List< T >.

Definition at line 90 of file SortableList.C.

Referenced by SortableList< T >::shrink().

Here is the caller graph for this function:

Foam::List< T > & shrink (  )  [inline]

Clear the indices and return a reference to the underlying List.

Definition at line 98 of file SortableList.C.

References SortableList< T >::clear().

Here is the call graph for this function:

void sort (  )  [inline]

(stable) sort the list (if changed after construction time)

also resizes the indices as required

Definition at line 106 of file SortableList.C.

Referenced by SortableList< T >::SortableList(), and PatchTools::sortedEdgeFaces().

Here is the caller graph for this function:

void reverseSort (  )  [inline]

Reverse (stable) sort the list.

Definition at line 121 of file SortableList.C.

References UList< T >::operator[]().

Here is the call graph for this function:

Foam::Xfer< Foam::List< T > > xfer (  )  [inline]

Transfer contents to the Xfer container as a plain List.

Reimplemented from List< T >.

Definition at line 137 of file SortableList.C.

References UList< T >::operator[]().

Here is the call graph for this function:

void operator= ( const T &  t  )  [inline]

Assignment of all entries to the given value.

Reimplemented from List< T >.

Definition at line 146 of file SortableList.C.

Referenced by SortableList< T >::operator=().

Here is the caller graph for this function:

void operator= ( const UList< T > &  rhs  )  [inline]

Assignment from UList operator. Takes linear time.

Reimplemented from List< T >.

Definition at line 153 of file SortableList.C.

References SortableList< T >::operator=().

Here is the call graph for this function:

void operator= ( const SortableList< T > &  rhs  )  [inline]

Assignment operator. Takes linear time.

Definition at line 161 of file SortableList.C.

References SortableList< T >::operator=().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd