An Istream is an abstract base class for all input systems (streams, files, token lists etc). The basic operations are construct, close, read token, read primitive and read binary block. More...
#include <OpenFOAM/Istream.H>
An Istream is an abstract base class for all input systems (streams, files, token lists etc). The basic operations are construct, close, read token, read primitive and read binary block.
In addition, version control and line number counting is incorporated. Usually one would use the read primitive member functions, but if one were reading a stream on unknown data sequence one can read token by token, and then analyse.
Definition at line 58 of file Istream.H.
Public Member Functions | |
Istream (streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED) | |
Set stream status.
| |
virtual | ~Istream () |
void | putBack (const token &) |
Put back token.
| |
bool | getBack (token &) |
Get the put back token.
| |
virtual Istream & | read (token &)=0 |
Return next token from stream.
| |
virtual Istream & | read (char &)=0 |
Read a character.
| |
virtual Istream & | read (word &)=0 |
Read a word.
| |
virtual Istream & | read (string &)=0 |
virtual Istream & | read (label &)=0 |
Read a label.
| |
virtual Istream & | read (floatScalar &)=0 |
Read a floatScalar.
| |
virtual Istream & | read (doubleScalar &)=0 |
Read a doubleScalar.
| |
virtual Istream & | read (char *, std::streamsize)=0 |
Read binary block.
| |
virtual Istream & | rewind ()=0 |
Rewind and return the stream so that it may be read again.
| |
Istream & | readBegin (const char *funcName) |
Istream & | readEnd (const char *funcName) |
Istream & | readEndBegin (const char *funcName) |
char | readBeginList (const char *funcName) |
char | readEndList (const char *funcName) |
Istream & | operator() () const |
Return a non-const reference to const Istream.
|
Istream | ( | streamFormat | format = ASCII ,
|
versionNumber | version = currentVersion ,
|
||
compressionType | compression = UNCOMPRESSED
|
||
) | [inline]
|
void putBack | ( | const token & | t ) |
Put back token.
Definition at line 56 of file Istream.C.
References Foam::exit(), Foam::FatalIOError, and FatalIOErrorIn.
Referenced by Field< Type >::Field(), genericFvPatchField< Type >::genericFvPatchField(), entry::New(), Foam::operator>>(), dictionary::read(), PtrList< T >::read(), IOPosition< ParticleType >::readData(), and Foam::readList().
bool getBack | ( | token & | t ) |
Get the put back token.
Definition at line 34 of file Istream.C.
References IOstream::bad(), Foam::exit(), Foam::FatalIOError, and FatalIOErrorIn.
Referenced by ITstream::read(), ISstream::read(), and IPstream::read().
Return next token from stream.
Implemented in IPstream, ISstream, and ITstream.
Referenced by Foam::operator>>(), Particle< ParticleType >::Particle(), primitiveEntry::read(), Foam::readChar(), Foam::readLongLong(), and token::token().
virtual Istream& read | ( | char & | ) | [pure virtual]
|
virtual Istream& read | ( | label & | ) | [pure virtual]
|
virtual Istream& read | ( | floatScalar & | ) | [pure virtual]
|
virtual Istream& read | ( | doubleScalar & | ) | [pure virtual]
|
virtual Istream& read | ( | char * | , |
std::streamsize | |||
) | [pure virtual]
|
virtual Istream& rewind | ( | ) | [pure virtual]
|
Foam::Istream & readBegin | ( | const char * | funcName ) |
Definition at line 80 of file Istream.C.
References token::BEGIN_LIST, Foam::exit(), Foam::FatalIOError, FatalIOErrorIn, and token::info().
Referenced by LangmuirHinshelwoodReactionRate::LangmuirHinshelwoodReactionRate(), line< Point, PointRef >::line(), objectMap::objectMap(), Foam::operator>>(), tetrahedron< Point, PointRef >::tetrahedron(), triangle< Point, PointRef >::triangle(), Tuple< Type1, Type2 >::Tuple(), and VectorSpace< Form, Cmpt, nCmpt >::VectorSpace().
Foam::Istream & readEnd | ( | const char * | funcName ) |
Definition at line 97 of file Istream.C.
References token::END_LIST, Foam::exit(), Foam::FatalIOError, FatalIOErrorIn, and token::info().
Referenced by ArrheniusReactionRate::ArrheniusReactionRate(), ChemicallyActivatedReactionRate< ReactionRate, ChemicallyActivationFunction >::ChemicallyActivatedReactionRate(), FallOffReactionRate< ReactionRate, FallOffFunction >::FallOffReactionRate(), JanevReactionRate::JanevReactionRate(), LandauTellerReactionRate::LandauTellerReactionRate(), LangmuirHinshelwoodReactionRate::LangmuirHinshelwoodReactionRate(), line< Point, PointRef >::line(), objectMap::objectMap(), Foam::operator>>(), powerSeriesReactionRate::powerSeriesReactionRate(), SRIFallOffFunction::SRIFallOffFunction(), tetrahedron< Point, PointRef >::tetrahedron(), thirdBodyArrheniusReactionRate::thirdBodyArrheniusReactionRate(), triangle< Point, PointRef >::triangle(), TroeFallOffFunction::TroeFallOffFunction(), Tuple< Type1, Type2 >::Tuple(), and VectorSpace< Form, Cmpt, nCmpt >::VectorSpace().
Foam::Istream & readEndBegin | ( | const char * | funcName ) |
char readBeginList | ( | const char * | funcName ) |
Definition at line 123 of file Istream.C.
References token::BEGIN_BLOCK, token::BEGIN_LIST, Foam::exit(), Foam::FatalIOError, FatalIOErrorIn, token::info(), and token::pToken().
Referenced by Foam::operator>>(), PtrList< T >::read(), IOPosition< ParticleType >::readData(), and thirdBodyEfficiencies::thirdBodyEfficiencies().
char readEndList | ( | const char * | funcName ) |
Definition at line 144 of file Istream.C.
References token::END_BLOCK, token::END_LIST, Foam::exit(), Foam::FatalIOError, FatalIOErrorIn, token::info(), and token::pToken().
Referenced by Foam::operator>>(), PtrList< T >::read(), and IOPosition< ParticleType >::readData().
Foam::Istream & operator() | ( | ) | const |
Return a non-const reference to const Istream.
Needed for read-constructors where the stream argument is temporary: e.g. thing thisThing(IFstream("thingFileName")());
Reimplemented in IFstream, and IStringStream.
Definition at line 165 of file Istream.C.
References IOerror::exit(), and Foam::FatalIOError.