LabelledItem< T > Class Template Reference

A container with an integer index that can be attached to any item. The index may be useful for sorting or storing additional information. More...

Public Member Functions

 LabelledItem ()
 Default construct item, with index = -1. More...
 
 LabelledItem (const T &item)
 Copy construct item, with index = -1. More...
 
 LabelledItem (T &&item)
 Move construct item, with index = -1. More...
 
 LabelledItem (const T &item, label idx)
 Construct from components. More...
 
 LabelledItem (Istream &is)
 Construct from Istream. More...
 
label index () const noexcept
 Return the index. More...
 
label & index () noexcept
 Non-const access to the index. More...
 
void setIndex (const label idx) noexcept
 Set the index. More...
 
bool operator== (const LabelledItem< T > &rhs) const
 Test for equality of components. More...
 
bool operator!= (const LabelledItem< T > &rhs) const
 Test for inequality of components. More...
 

Friends

Istreamoperator>> (Istream &, LabelledItem< T > &)
 
Ostreamoperator (Ostream &, const LabelledItem< T > &)
 

Detailed Description

template<class T>
class Foam::LabelledItem< T >

A container with an integer index that can be attached to any item. The index may be useful for sorting or storing additional information.

See also
Foam::objectHit Foam::PointIndexHit
Source files

Definition at line 53 of file LabelledItem.H.

Constructor & Destructor Documentation

◆ LabelledItem() [1/5]

LabelledItem ( )
inline

Default construct item, with index = -1.

Definition at line 78 of file LabelledItem.H.

◆ LabelledItem() [2/5]

LabelledItem ( const T item)
inlineexplicit

Copy construct item, with index = -1.

Definition at line 85 of file LabelledItem.H.

◆ LabelledItem() [3/5]

LabelledItem ( T &&  item)
inlineexplicit

Move construct item, with index = -1.

Definition at line 92 of file LabelledItem.H.

◆ LabelledItem() [4/5]

LabelledItem ( const T item,
label  idx 
)
inline

Construct from components.

Definition at line 99 of file LabelledItem.H.

◆ LabelledItem() [5/5]

LabelledItem ( Istream is)
inlineexplicit

Construct from Istream.

Definition at line 106 of file LabelledItem.H.

Member Function Documentation

◆ index() [1/2]

label index ( ) const
inlinenoexcept

Return the index.

Definition at line 115 of file LabelledItem.H.

◆ index() [2/2]

label& index ( )
inlinenoexcept

Non-const access to the index.

Definition at line 121 of file LabelledItem.H.

◆ setIndex()

void setIndex ( const label  idx)
inlinenoexcept

Set the index.

Definition at line 127 of file LabelledItem.H.

◆ operator==()

bool operator== ( const LabelledItem< T > &  rhs) const
inline

Test for equality of components.

Definition at line 136 of file LabelledItem.H.

References Foam::T().

Here is the call graph for this function:

◆ operator!=()

bool operator!= ( const LabelledItem< T > &  rhs) const
inline

Test for inequality of components.

Definition at line 146 of file LabelledItem.H.

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream ,
LabelledItem< T > &   
)
friend

◆ operator

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

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