Public Member Functions | Static Public Member Functions | Friends | List of all members
Keyed< T > Class Template Reference

A container with an integer key attached to any item. More...

Inheritance diagram for Keyed< T >:
Inheritance graph
[legend]
Collaboration diagram for Keyed< T >:
Collaboration graph
[legend]

Public Member Functions

 Keyed ()
 Construct null. More...
 
 Keyed (const T &item, const label key=0)
 Construct as a copy of item, with a key. More...
 
 Keyed (const Xfer< T > &item, const label key=0)
 Construct by transferring the item, with a key. More...
 
 Keyed (Istream &)
 Construct from Istream. More...
 
label key () const
 Return const access to the integer key. More...
 
labelkey ()
 Return non-const access to the integer key. More...
 

Static Public Member Functions

static List< Keyed< T > > createList (const List< T > &, const label key=0)
 Add labels to a list of values. More...
 
static List< Keyed< T > > createList (const List< T > &, const labelUList &keys)
 Add labels to a list of values. More...
 

Friends

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

Detailed Description

template<class T>
class Foam::Keyed< T >

A container with an integer key attached to any item.

The key can useful for sorting.

Source files

Definition at line 48 of file Keyed.H.

Constructor & Destructor Documentation

◆ Keyed() [1/4]

Keyed ( )
inline

Construct null.

Definition at line 33 of file KeyedI.H.

Referenced by Keyed< T >::createList().

Here is the caller graph for this function:

◆ Keyed() [2/4]

Keyed ( const T item,
const label  key = 0 
)
inline

Construct as a copy of item, with a key.

Definition at line 40 of file KeyedI.H.

◆ Keyed() [3/4]

Keyed ( const Xfer< T > &  item,
const label  key = 0 
)
inline

Construct by transferring the item, with a key.

Definition at line 48 of file KeyedI.H.

◆ Keyed() [4/4]

Keyed ( Istream is)
inline

Construct from Istream.

Definition at line 56 of file KeyedI.H.

Member Function Documentation

◆ createList() [1/2]

Foam::List< Foam::Keyed< T > > createList ( const List< T > &  lst,
const label  key = 0 
)
inlinestatic

Add labels to a list of values.

Definition at line 79 of file KeyedI.H.

References forAll, Keyed< T >::Keyed(), and List< T >::size().

Here is the call graph for this function:

◆ createList() [2/2]

Foam::List< Foam::Keyed< T > > createList ( const List< T > &  lst,
const labelUList keys 
)
inlinestatic

◆ key() [1/2]

Foam::label key ( ) const
inline

Return const access to the integer key.

Definition at line 65 of file KeyedI.H.

◆ key() [2/2]

Foam::label & key ( )
inline

Return non-const access to the integer key.

Definition at line 71 of file KeyedI.H.

Friends And Related Function Documentation

◆ operator>>

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

◆ operator

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

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