Public Member Functions | Friends | List of all members
namedDictionary Class Reference

A tuple of keyType and dictionary, which can be used when reading named or unnamed dictionary entries or simply a name. More...

Inheritance diagram for namedDictionary:
Inheritance graph
[legend]
Collaboration diagram for namedDictionary:
Collaboration graph
[legend]

Public Member Functions

 namedDictionary ()
 
 namedDictionary (Istream &is)
 
 ~namedDictionary ()=default
 
void clear ()
 
bool empty () const noexcept
 
const keyTypekeyword () const noexcept
 
keyTypekeyword () noexcept
 
const dictionarydict () const noexcept
 
dictionarydict () noexcept
 
- Public Member Functions inherited from Tuple2< keyType, dictionary >
 Tuple2 ()=default
 
 Tuple2 (const T1 &f, const T2 &s)
 
 Tuple2 (T1 &&f, T2 &&s)
 
 Tuple2 (const std::pair< T1, T2 > &vals)
 
 Tuple2 (std::pair< T1, T2 > &&vals)
 
 Tuple2 (Istream &is)
 
const T1 & first () const noexcept
 
T1 & first () noexcept
 
const T2 & second () const noexcept
 
T2 & second () noexcept
 

Friends

Istreamoperator>> (Istream &, namedDictionary &)
 
Ostreamoperator<< (Ostream &, const namedDictionary &)
 

Additional Inherited Members

- Public Types inherited from Tuple2< keyType, dictionary >
typedef T1 first_type
 
typedef T2 second_type
 

Detailed Description

A tuple of keyType and dictionary, which can be used when reading named or unnamed dictionary entries or simply a name.

For example,

fields
(
    U
    T { relax  false; }
);

In can also be used in situations where an individual dictionary entry should be read.

actions
(
    testing { action new; ... }   // An action with a name
    { action subset;  }           // Unnamed action
);

Normal dictionary reading would fail for this type of input since the leading 'testing' keyword would cause the entire content to be considered a single dictionary.

Note
No distinction currently made between a missing and an empty dictionary.
Source files

Definition at line 79 of file namedDictionary.H.

Constructor & Destructor Documentation

◆ namedDictionary() [1/2]

Definition at line 26 of file namedDictionary.C.

◆ namedDictionary() [2/2]

namedDictionary ( Istream is)
explicit

Definition at line 32 of file namedDictionary.C.

◆ ~namedDictionary()

~namedDictionary ( )
default

Member Function Documentation

◆ clear()

void clear ( )

Definition at line 40 of file namedDictionary.C.

Referenced by Foam::operator>>().

Here is the caller graph for this function:

◆ empty()

bool empty ( ) const
noexcept

Definition at line 47 of file namedDictionary.C.

◆ keyword() [1/2]

const keyType& keyword ( ) const
inlinenoexcept

Definition at line 110 of file namedDictionary.H.

References Tuple2< keyType, dictionary >::first().

Referenced by Foam::operator<<(), and Foam::operator>>().

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

◆ keyword() [2/2]

keyType& keyword ( )
inlinenoexcept

Definition at line 116 of file namedDictionary.H.

References Tuple2< keyType, dictionary >::first().

Here is the call graph for this function:

◆ dict() [1/2]

const dictionary& dict ( ) const
inlinenoexcept

Definition at line 122 of file namedDictionary.H.

References Tuple2< keyType, dictionary >::second().

Referenced by Foam::operator<<(), and Foam::operator>>().

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

◆ dict() [2/2]

dictionary& dict ( )
inlinenoexcept

Definition at line 128 of file namedDictionary.H.

References Tuple2< keyType, dictionary >::second().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream ,
namedDictionary  
)
friend

◆ operator<<

Ostream& operator<< ( Ostream ,
const namedDictionary  
)
friend

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