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 | |
| Istream & | operator>> (Istream &, tokenTupleN &) |
| Read from stream. More... | |
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.
Definition at line 74 of file tokenTupleN.H.
| tokenTupleN | ( | ) |
Default construct.
Definition at line 30 of file tokenTupleN.C.
| tokenTupleN | ( | Istream & | is | ) |
Construct from stream.
Definition at line 37 of file tokenTupleN.C.
| ~tokenTupleN | ( | ) |
Destructor.
Definition at line 48 of file tokenTupleN.C.
|
inline |
Get the number of elements in the tuple.
Definition at line 32 of file tokenTupleNI.H.
References List< T >::size().

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

|
friend |
Read from stream.