UIndirectList< T > Class Template Reference

A List with indirect addressing. More...

Inheritance diagram for UIndirectList< T >:

Public Types

typedef T value_type
 Type of values the UList contains. More...
 
typedef Treference
 Type that can be used for storing into. More...
 
typedef const Tconst_reference
 Type that can be used for storing into. More...
 
typedef label difference_type
 The type that can represent the difference between any two. More...
 
typedef label size_type
 The type that can represent the size of a UList. More...
 

Public Member Functions

 UIndirectList (const UList< T > &, const UList< label > &)
 Construct given the complete list and the addressing array. More...
 
 UIndirectList (const UIndirectList< T > &)=default
 Copy constructor. More...
 
label size () const
 Return the number of elements in the list. More...
 
bool empty () const
 Return true if the list is empty (ie, size() is zero). More...
 
Tfirst ()
 Return the first element of the list. More...
 
const Tfirst () const
 Return first element of the list. More...
 
Tlast ()
 Return the last element of the list. More...
 
const Tlast () const
 Return the last element of the list. More...
 
label fcIndex (const label i) const
 Return the forward circular index, i.e. the next index. More...
 
label rcIndex (const label i) const
 Return the reverse circular index, i.e. the previous index. More...
 
const UList< T > & completeList () const
 Return the complete list. More...
 
const List< label > & addressing () const
 Return the list addressing. More...
 
List< Toperator() () const
 Return the addressed elements as a List. More...
 
Toperator[] (const label)
 Return non-const access to an element. More...
 
const Toperator[] (const label) const
 Return const access to an element. More...
 
void operator= (const UList< T > &)
 Assignment to UList of addressed elements. More...
 
void operator= (const UIndirectList< T > &)
 Assignment to UIndirectList of addressed elements. More...
 
void operator= (const T &)
 Assignment of all entries to the given value. More...
 

Friends

Ostreamoperator (Ostream &, const UIndirectList< T > &)
 Write UIndirectList to Ostream. More...
 

Detailed Description

template<class T>
class Foam::UIndirectList< T >

A List with indirect addressing.

Like IndirectList but does not store addressing.

Note the const_cast of the completeList. This is so we can use it both on const and non-const lists. Alternative would be to have a const_ variant etc.

Source files

Definition at line 59 of file UIndirectList.H.

Member Typedef Documentation

◆ value_type

typedef T value_type

Type of values the UList contains.

Definition at line 139 of file UIndirectList.H.

◆ reference

typedef T& reference

Type that can be used for storing into.

UList::value_type objects.

Definition at line 143 of file UIndirectList.H.

◆ const_reference

typedef const T& const_reference

Type that can be used for storing into.

constant UList::value_type objects

Definition at line 147 of file UIndirectList.H.

◆ difference_type

The type that can represent the difference between any two.

UList iterator objects.

Definition at line 151 of file UIndirectList.H.

◆ size_type

typedef label size_type

The type that can represent the size of a UList.

Definition at line 154 of file UIndirectList.H.

Constructor & Destructor Documentation

◆ UIndirectList() [1/2]

UIndirectList ( const UList< T > &  completeList,
const UList< label > &  addr 
)
inline

Construct given the complete list and the addressing array.

Definition at line 29 of file UIndirectListI.H.

◆ UIndirectList() [2/2]

UIndirectList ( const UIndirectList< T > &  )
default

Copy constructor.

Member Function Documentation

◆ size()

◆ empty()

bool empty
inline

Return true if the list is empty (ie, size() is zero).

Definition at line 50 of file UIndirectListI.H.

◆ first() [1/2]

T & first
inline

Return the first element of the list.

Definition at line 57 of file UIndirectListI.H.

◆ first() [2/2]

const T & first
inline

Return first element of the list.

Definition at line 64 of file UIndirectListI.H.

◆ last() [1/2]

T & last
inline

Return the last element of the list.

Definition at line 71 of file UIndirectListI.H.

◆ last() [2/2]

const T & last
inline

Return the last element of the list.

Definition at line 78 of file UIndirectListI.H.

◆ fcIndex()

Foam::label fcIndex ( const label  i) const
inline

Return the forward circular index, i.e. the next index.

which returns to the first at the end of the list

Definition at line 85 of file UIndirectListI.H.

◆ rcIndex()

Foam::label rcIndex ( const label  i) const
inline

Return the reverse circular index, i.e. the previous index.

which returns to the last at the beginning of the list

Definition at line 92 of file UIndirectListI.H.

◆ completeList()

const Foam::UList< T > & completeList
inline

Return the complete list.

Definition at line 99 of file UIndirectListI.H.

◆ addressing()

◆ operator()()

Foam::List< T > operator()
inline

Return the addressed elements as a List.

Definition at line 115 of file UIndirectListI.H.

◆ operator[]() [1/2]

T & operator[] ( const label  i)
inline

Return non-const access to an element.

Definition at line 129 of file UIndirectListI.H.

◆ operator[]() [2/2]

const T & operator[] ( const label  i) const
inline

Return const access to an element.

Definition at line 136 of file UIndirectListI.H.

◆ operator=() [1/3]

void operator= ( const UList< T > &  ae)
inline

Assignment to UList of addressed elements.

Definition at line 143 of file UIndirectListI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, and UList< T >::size().

Here is the call graph for this function:

◆ operator=() [2/3]

void operator= ( const UIndirectList< T > &  ae)
inline

Assignment to UIndirectList of addressed elements.

Definition at line 162 of file UIndirectListI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, and UIndirectList< T >::size().

Here is the call graph for this function:

◆ operator=() [3/3]

void operator= ( const T t)
inline

Assignment of all entries to the given value.

Definition at line 181 of file UIndirectListI.H.

References forAll.

Friends And Related Function Documentation

◆ operator

Ostream& operator ( Ostream ,
const UIndirectList< T > &   
)
friend

Write UIndirectList to Ostream.

Binary output is currently still a bit of a problem


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