Public Member Functions | Private Member Functions | Private Attributes
csvTableReader< Type > Class Template Reference

Reads an interpolation table from a file - CSV-format. More...

Inheritance diagram for csvTableReader< Type >:
Inheritance graph
[legend]
Collaboration diagram for csvTableReader< Type >:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("csv")
 Runtime type information. More...
 
 csvTableReader (const dictionary &dict)
 Construct from dictionary. More...
 
virtual autoPtr< tableReader< Type > > clone () const
 Construct and return a copy. More...
 
virtual ~csvTableReader ()
 Destructor. More...
 
virtual void operator() (const fileName &, List< Tuple2< scalar, Type > > &)
 Read the table. More...
 
virtual void operator() (const fileName &, List< Tuple2< scalar, List< Tuple2< scalar, Type > > > > &)
 Read 2D table. More...
 
virtual void write (Ostream &os) const
 Write the remaining parameters. More...
 
- Public Member Functions inherited from tableReader< Type >
 TypeName ("tableReader")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, tableReader, dictionary,(const dictionary &dict),(dict))
 
 tableReader (const dictionary &dict)
 Construct from dictionary. More...
 
virtual ~tableReader ()
 Destructor. More...
 

Private Member Functions

Type readValue (const List< string > &)
 Read the next value from the splitted string. More...
 
scalar readValue (const List< string > &splitted)
 

Private Attributes

const bool headerLine_
 Does the file have a header line? More...
 
const label timeColumn_
 Column of the time. More...
 
const labelList componentColumns_
 Labels of the components. More...
 
const char separator_
 Separator character. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from tableReader< Type >
static autoPtr< tableReaderNew (const dictionary &spec)
 Return a reference to the selected tableReader. More...
 

Detailed Description

template<class Type>
class Foam::csvTableReader< Type >

Reads an interpolation table from a file - CSV-format.

Source files

Definition at line 50 of file csvTableReader.H.

Constructor & Destructor Documentation

◆ csvTableReader()

csvTableReader ( const dictionary dict)

Construct from dictionary.

Definition at line 33 of file csvTableReader.C.

References csvTableReader< Type >::componentColumns_, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and List::size().

Here is the call graph for this function:

◆ ~csvTableReader()

~csvTableReader
virtual

Destructor.

Definition at line 54 of file csvTableReader.C.

Member Function Documentation

◆ readValue() [1/2]

Type readValue ( const List< string > &  splitted)
private

Read the next value from the splitted string.

Definition at line 79 of file csvTableReader.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::readScalar(), and List::size().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "csv"  )

Runtime type information.

◆ clone()

virtual autoPtr<tableReader<Type> > clone ( ) const
inlinevirtual

Construct and return a copy.

Implements tableReader< Type >.

Definition at line 84 of file csvTableReader.H.

◆ operator()() [1/2]

void operator() ( const fileName fName,
List< Tuple2< scalar, Type > > &  data 
)
virtual

Read the table.

Implements tableReader< Type >.

Definition at line 106 of file csvTableReader.C.

References DynamicList::append(), ISstream::getLine(), IOstream::good(), Foam::pos(), Foam::readScalar(), and dictionary::transfer().

Here is the call graph for this function:

◆ operator()() [2/2]

void operator() ( const fileName fName,
List< Tuple2< scalar, List< Tuple2< scalar, Type > > > > &  data 
)
virtual

Read 2D table.

Implements tableReader< Type >.

Definition at line 163 of file csvTableReader.C.

References NotImplemented.

◆ write()

void write ( Ostream os) const
virtual

Write the remaining parameters.

Reimplemented from tableReader< Type >.

Definition at line 173 of file csvTableReader.C.

References IOstream::ASCII, IOstream::BINARY, token::END_STATEMENT, IOstream::format(), Foam::nl, tableReader< Type >::write(), and Ostream::writeKeyword().

Here is the call graph for this function:

◆ readValue() [2/2]

scalar readValue ( const List< string > &  splitted)
private

Definition at line 64 of file csvTableReader.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::readScalar(), and List::size().

Here is the call graph for this function:

Field Documentation

◆ headerLine_

const bool headerLine_
private

Does the file have a header line?

Definition at line 57 of file csvTableReader.H.

◆ timeColumn_

const label timeColumn_
private

Column of the time.

Definition at line 60 of file csvTableReader.H.

◆ componentColumns_

const labelList componentColumns_
private

Labels of the components.

Definition at line 63 of file csvTableReader.H.

Referenced by csvTableReader< Type >::csvTableReader().

◆ separator_

const char separator_
private

Separator character.

Definition at line 69 of file csvTableReader.H.


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