Public Member Functions | Static Public Member Functions | Private Attributes | Friends
Keyed Class Reference

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

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...
 

Private Attributes

label key_
 

Friends

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

Detailed Description

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.

◆ Keyed() [2/4]

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

Construct as a copy of item, with a key.

◆ Keyed() [3/4]

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

Construct by transferring the item, with a key.

◆ Keyed() [4/4]

Keyed ( Istream )
inline

Construct from Istream.

Member Function Documentation

◆ createList() [1/2]

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

Add labels to a list of values.

◆ createList() [2/2]

static List<Keyed<T> > createList ( const List< T > &  ,
const labelUList keys 
)
inlinestatic

Add labels to a list of values.

◆ 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

Field Documentation

◆ key_

label key_
private

Definition at line 64 of file Keyed.H.


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