Loading...
Searching...
No Matches
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...

#include <LabelledItem.H>

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

Public Member Functions

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

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 58 of file LabelledItem.H.

Constructor & Destructor Documentation

◆ LabelledItem() [1/5]

template<class T>
LabelledItem ( )
inline

Default construct item, with index = -1.

Definition at line 78 of file LabelledItem.H.

References Foam::T().

Referenced by operator!=(), operator<<, operator==(), and operator>>.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LabelledItem() [2/5]

template<class T>
LabelledItem ( const T & item)
inlineexplicit

Copy construct item, with index = -1.

Definition at line 87 of file LabelledItem.H.

References Foam::T().

Here is the call graph for this function:

◆ LabelledItem() [3/5]

template<class T>
LabelledItem ( T && item)
inlineexplicit

Move construct item, with index = -1.

Definition at line 96 of file LabelledItem.H.

References Foam::T().

Here is the call graph for this function:

◆ LabelledItem() [4/5]

template<class T>
LabelledItem ( const T & item,
label idx )
inline

Construct from components.

Definition at line 105 of file LabelledItem.H.

References Foam::T().

Here is the call graph for this function:

◆ LabelledItem() [5/5]

template<class T>
LabelledItem ( Istream & is)
inlineexplicit

Construct from Istream.

Definition at line 114 of file LabelledItem.H.

Member Function Documentation

◆ index() [1/2]

template<class T>
label index ( ) const
inlinenoexcept

Return the index.

Definition at line 125 of file LabelledItem.H.

References Foam::noexcept.

◆ index() [2/2]

template<class T>
label & index ( )
inlinenoexcept

Non-const access to the index.

Definition at line 133 of file LabelledItem.H.

References Foam::noexcept.

◆ setIndex()

template<class T>
void setIndex ( const label idx)
inlinenoexcept

Set the index.

Definition at line 141 of file LabelledItem.H.

◆ operator==()

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

Test for equality of components.

Definition at line 152 of file LabelledItem.H.

References LabelledItem(), Foam::rhs(), and Foam::T().

Here is the call graph for this function:

◆ operator!=()

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

Test for inequality of components.

Definition at line 164 of file LabelledItem.H.

References LabelledItem(), and Foam::rhs().

Here is the call graph for this function:

◆ operator>>

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

References LabelledItem(), and Foam::T().

◆ operator<<

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

References LabelledItem().


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