Public Types | Public Member Functions | Friends | List of all members
UIndirectList< T > Class Template Reference

A List with indirect addressing. More...

Inheritance diagram for UIndirectList< T >:
Inheritance graph
[legend]

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 labelUList &)
 Construct given the complete list and the addressing array. 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...
 
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 from UList of addressed elements. More...
 
void operator= (const UIndirectList< T > &)
 Assignment from 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 106 of file fvMatrix.H.

Member Typedef Documentation

typedef T value_type

Type of values the UList contains.

Definition at line 128 of file UIndirectList.H.

typedef T& reference

Type that can be used for storing into.

UList::value_type objects.

Definition at line 132 of file UIndirectList.H.

typedef const T& const_reference

Type that can be used for storing into.

constant UList::value_type objects

Definition at line 136 of file UIndirectList.H.

The type that can represent the difference between any two.

UList iterator objects.

Definition at line 140 of file UIndirectList.H.

typedef label size_type

The type that can represent the size of a UList.

Definition at line 143 of file UIndirectList.H.

Constructor & Destructor Documentation

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

Construct given the complete list and the addressing array.

Definition at line 30 of file UIndirectListI.H.

Member Function Documentation

Foam::label size ( ) const
inline
bool empty ( ) const
inline

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

Definition at line 50 of file UIndirectListI.H.

T & first ( )
inline

Return the first element of the list.

Definition at line 57 of file UIndirectListI.H.

const T & first ( ) const
inline

Return first element of the list.

Definition at line 64 of file UIndirectListI.H.

T & last ( )
inline

Return the last element of the list.

Definition at line 71 of file UIndirectListI.H.

const T & last ( ) const
inline

Return the last element of the list.

Definition at line 78 of file UIndirectListI.H.

const Foam::UList< T > & completeList ( ) const
inline

Return the complete list.

Definition at line 85 of file UIndirectListI.H.

const Foam::List< Foam::label > & addressing ( ) const
inline

Return the list addressing.

Definition at line 92 of file UIndirectListI.H.

Foam::List< T > operator() ( ) const
inline

Return the addressed elements as a List.

Definition at line 101 of file UIndirectListI.H.

References forAll.

T & operator[] ( const label  i)
inline

Return non-const access to an element.

Definition at line 115 of file UIndirectListI.H.

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

Return const access to an element.

Definition at line 122 of file UIndirectListI.H.

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

Assignment from UList of addressed elements.

Definition at line 129 of file UIndirectListI.H.

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

Here is the call graph for this function:

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

Assignment from UIndirectList of addressed elements.

Definition at line 148 of file UIndirectListI.H.

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

Here is the call graph for this function:

void operator= ( const T t)
inline

Assignment of all entries to the given value.

Definition at line 167 of file UIndirectListI.H.

References forAll.

Friends And Related Function Documentation

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: