tokenTupleN Class Reference

Reads a n-component tuple, storing the result as a list of tokens, using bracket counting to disambiguate types. This allows foam-format tables of mixed types to be read and columns extracted, provided that the complex types are bounded by parentheses. For example, the following table, with scalar, vector, scalar, and symmTensor columns could be read as a list of tokenTupleN-s: More...

Public Member Functions

 tokenTupleN ()
 Default construct. More...
 
 tokenTupleN (Istream &is)
 Construct from stream. More...
 
 ~tokenTupleN ()
 Destructor. More...
 
label size () const
 Get the number of elements in the tuple. More...
 
template<class Type >
Type get (const IOstream &s, const label i)
 Get a type at a given position in the tuple. Stream used for error. More...
 

Friends

Istreamoperator>> (Istream &, tokenTupleN &)
 Read from stream. More...
 

Detailed Description

Reads a n-component tuple, storing the result as a list of tokens, using bracket counting to disambiguate types. This allows foam-format tables of mixed types to be read and columns extracted, provided that the complex types are bounded by parentheses. For example, the following table, with scalar, vector, scalar, and symmTensor columns could be read as a list of tokenTupleN-s:

    (
        (0 (1 2 3) 4 (5 6 7 8 9 10))
        (1 (2 3 4) 5 (6 7 8 9 10 11))
        (2 (3 4 5) 6 (7 8 9 10 11 12))
    )

Once constructed, this type then provides type-based access to the components of the tuple so that they can be extracted into a different structure.

Source files

Definition at line 74 of file tokenTupleN.H.

Constructor & Destructor Documentation

◆ tokenTupleN() [1/2]

Default construct.

Definition at line 30 of file tokenTupleN.C.

◆ tokenTupleN() [2/2]

tokenTupleN ( Istream is)

Construct from stream.

Definition at line 37 of file tokenTupleN.C.

◆ ~tokenTupleN()

Destructor.

Definition at line 48 of file tokenTupleN.C.

Member Function Documentation

◆ size()

Foam::label size ( ) const
inline

Get the number of elements in the tuple.

Definition at line 32 of file tokenTupleNI.H.

References List< T >::size().

Here is the call graph for this function:

◆ get()

Type get ( const IOstream s,
const label  i 
)
inline

Get a type at a given position in the tuple. Stream used for error.

reporting only.

Definition at line 39 of file tokenTupleNI.H.

References Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, and s().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream ,
tokenTupleN  
)
friend

Read from stream.


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