OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

IOobject Class Reference

IOobject defines the attributes of an object for which implicit objectRegistry management is supported, and provides the infrastructure for performing stream I/O. More...

Inheritance diagram for IOobject:
Collaboration diagram for IOobject:

List of all members.


Public Types

enum  objectState { GOOD, BAD }
 Enumeration defining the valid states of an IOobject. More...
enum  readOption { MUST_READ, READ_IF_PRESENT, NO_READ }
 Enumeration defining the read options. More...
enum  writeOption { AUTO_WRITE = 0, NO_WRITE = 1 }
 Enumeration defining the write options. More...

Public Member Functions

 TypeName ("IOobject")
 Runtime type information.
 IOobject (const word &name, const fileName &instance, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
 Construct from name, instance, registry, io options.
 IOobject (const word &name, const fileName &instance, const fileName &local, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
 Construct from name, instance, local, registry, io options.
 IOobject (const fileName &path, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
 Construct from path, registry, io options.
Foam::autoPtr< IOobjectclone () const
 Clone.
virtual ~IOobject ()
const Timetime () const
 Return time.
const objectRegistrydb () const
 Return the local objectRegistry.
const wordname () const
 Return name.
const wordheaderClassName () const
 Return name of the class name read from header.
stringnote ()
 Return non-constant access to the optional note.
const stringnote () const
 Return the optional note.
virtual void rename (const word &newName)
 Rename.
bool registerObject () const
 Register object created from this IOobject with registry if true.
readOption readOpt () const
readOptionreadOpt ()
writeOption writeOpt () const
writeOptionwriteOpt ()
const fileNamerootPath () const
const fileNamecaseName () const
const fileNameinstance () const
fileNameinstance ()
const fileNamelocal () const
fileName path () const
 Return complete path.
fileName path (const word &instance, const fileName &local="") const
 Return complete path with alternative instance and local.
fileName objectPath () const
 Return complete path + object name.
fileName filePath () const
 Return complete path + object name if the file exists.
bool readHeader (Istream &)
 Read header.
bool headerOk ()
 Read and check header info.
bool writeHeader (Ostream &) const
 Write header.
bool good () const
bool bad () const
InfoProxy< IOobjectinfo () const
 Return info proxy.
void operator= (const IOobject &)

Static Public Member Functions

static bool fileNameComponents (const fileName &path, fileName &instance, fileName &local, word &name)
 Split path into instance, local, name components.
template<class Stream >
static Stream & writeBanner (Stream &os, bool noHint=false)
 Write the standard OpenFOAM file/dictionary banner.
template<class Stream >
static Stream & writeDivider (Stream &os)
 Write the standard file section divider.
template<class Stream >
static Stream & writeEndDivider (Stream &os)
 Write the standard end file divider.

Protected Member Functions

IstreamobjectStream ()
 Construct and return an IFstream for the object.
void setBad (const string &)
 Set the object state to bad.

Detailed Description

IOobject defines the attributes of an object for which implicit objectRegistry management is supported, and provides the infrastructure for performing stream I/O.

An IOobject is constructed with an object name, a class name, an instance path, a reference to a objectRegistry, and parameters determining its storage status.

Read options
Define what is done on object construction and explicit reads:
Parameters:
MUST_READ Object must be read from Istream on construction.
Error if Istream does not exist or can't be read.
READ_IF_PRESENT Read object from Istream if Istream exists, otherwise don't.
Error only if Istream exists but can't be read.
NO_READ Don't read
Write options
Define what is done on object destruction and explicit writes:
Parameters:
AUTO_WRITE Object is written automatically when requested to by the objectRegistry.
NO_WRITE No automatic write on destruction but can be written explicitly
Source files

Definition at line 80 of file IOobject.H.


Member Enumeration Documentation

Enumeration defining the valid states of an IOobject.

Enumerator:
GOOD 
BAD 

Definition at line 88 of file IOobject.H.

enum readOption

Enumeration defining the read options.

Enumerator:
MUST_READ 
READ_IF_PRESENT 
NO_READ 

Definition at line 95 of file IOobject.H.

Enumeration defining the write options.

Enumerator:
AUTO_WRITE 
NO_WRITE 

Definition at line 103 of file IOobject.H.


Constructor & Destructor Documentation

IOobject ( const word name,
const fileName instance,
const objectRegistry registry,
readOption  r = NO_READ,
writeOption  w = NO_WRITE,
bool  registerObject = true 
)

Construct from name, instance, registry, io options.

Definition at line 108 of file IOobject.C.

Referenced by IOobject::clone(), and Time::findInstance().

Here is the caller graph for this function:

IOobject ( const word name,
const fileName instance,
const fileName local,
const objectRegistry registry,
readOption  r = NO_READ,
writeOption  w = NO_WRITE,
bool  registerObject = true 
)

Construct from name, instance, local, registry, io options.

Definition at line 138 of file IOobject.C.

References Foam::endl(), and Foam::Info.

Here is the call graph for this function:

IOobject ( const fileName path,
const objectRegistry registry,
readOption  r = NO_READ,
writeOption  w = NO_WRITE,
bool  registerObject = true 
)

Construct from path, registry, io options.

Uses fileNameComponents() to split path into components.

Definition at line 169 of file IOobject.C.

References Foam::endl(), and Foam::Info.

Here is the call graph for this function:

~IOobject (  )  [virtual]

Definition at line 209 of file IOobject.C.


Member Function Documentation

Foam::Istream * objectStream (  )  [protected]

Construct and return an IFstream for the object.

The results is NULL if the stream construction failed

Definition at line 309 of file IOobject.C.

void setBad ( const string s  )  [protected]

Set the object state to bad.

Definition at line 375 of file IOobject.C.

TypeName ( "IOobject"   ) 

Runtime type information.

static bool fileNameComponents ( const fileName path,
fileName instance,
fileName local,
word name 
) [static]

Split path into instance, local, name components.

const word& name (  )  const [inline]

Return name.

Reimplemented in timeActivatedExplicitSource, fvMesh, IOOutputFilter< OutputFilter >, IOdictionary, UniformDimensionedField< Type >, and phase.

Definition at line 237 of file IOobject.H.

Referenced by fieldTable::add(), Foam::fvc::average(), fvMatrix< Type >::boundaryManipulate(), Foam::cmptAv(), hexRef8::consistentSlowRefinement(), linearUpwindV< Type >::correction(), linearUpwind< Type >::correction(), Foam::fvc::curl(), Foam::fvm::div(), Foam::fvc::div(), Foam::MULES::explicitSolve(), Time::findClosestTimeIndex(), Time::findInstance(), steadyStateD2dt2Scheme< Type >::fvcD2dt2(), EulerD2dt2Scheme< Type >::fvcD2dt2(), Foam::fvc::grad(), surfaceInterpolationScheme< Type >::interpolate(), localMin< Type >::interpolate(), localMax< Type >::interpolate(), localBlended< Type >::interpolate(), fvMeshSubset::interpolate(), Foam::fvc::laplacian(), LimitedScheme< Type, Limiter, LimitFunc >::limiter(), Foam::makeGraph(), Foam::mapClouds(), Foam::MapGeometricFields(), interpolation< Type >::New(), IOobject::objectPath(), Foam::operator<<(), Foam::pow(), Time::readDict(), Foam::ReadFields(), IOobject::readHeader(), Foam::fvc::reconstruct(), IOobjectList::remove(), fvMatrix< Type >::residual(), searchableSurfaces::searchableSurfaces(), Time::setEndTime(), Foam::setRefCell(), Time::setTime(), Foam::fvc::snGrad(), fvMatrix< Type >::solve(), fvSolver::solve(), Foam::sqr(), Foam::stabilise(), Time::times(), extendedUpwindCellToFaceStencil::weightedSum(), localBlended< Type >::weights(), addSubtract::writeAddSubtractField(), addSubtract::writeAddSubtractValue(), Foam::writeCellGraph(), components::writeComponentFields(), div::writeDivField(), IOobject::writeHeader(), interpolate::writeInterpolateField(), mag::writeMagField(), magGrad::writeMagGradField(), magSqr::writeMagSqrField(), regIOobject::writeObject(), Foam::writePatchGraph(), randomise::writeRandomField(), and triSurfaceMesh::~triSurfaceMesh().

const word& headerClassName (  )  const [inline]

string& note (  )  [inline]

Return non-constant access to the optional note.

Definition at line 249 of file IOobject.H.

Referenced by IOobject::writeHeader().

Here is the caller graph for this function:

const string& note (  )  const [inline]

Return the optional note.

Definition at line 255 of file IOobject.H.

virtual void rename ( const word newName  )  [inline, virtual]

Rename.

Reimplemented in objectRegistry, and regIOobject.

Definition at line 261 of file IOobject.H.

bool registerObject (  )  const [inline]

Register object created from this IOobject with registry if true.

Definition at line 267 of file IOobject.H.

Referenced by Foam::ReadFields().

Here is the caller graph for this function:

readOption readOpt (  )  const [inline]

Definition at line 275 of file IOobject.H.

Referenced by featureEdgeMesh::featureEdgeMesh(), IOField< Type >::IOField(), IOList< T >::IOList(), IOMap< T >::IOMap(), and IOPtrList< T >::IOPtrList().

Here is the caller graph for this function:

readOption& readOpt (  )  [inline]

Definition at line 280 of file IOobject.H.

writeOption writeOpt (  )  const [inline]

Definition at line 285 of file IOobject.H.

Referenced by GeometricField< Type, PatchField, GeoMesh >::nOldTimes(), and polyMesh::setInstance().

Here is the caller graph for this function:

writeOption& writeOpt (  )  [inline]

Definition at line 290 of file IOobject.H.

const Foam::fileName & rootPath (  )  const

Reimplemented in Time.

Definition at line 233 of file IOobject.C.

Referenced by IOobject::path().

Here is the caller graph for this function:

const Foam::fileName & caseName (  )  const

Reimplemented in Time.

Definition at line 227 of file IOobject.C.

Referenced by IOobject::path().

Here is the caller graph for this function:

fileName& instance (  )  [inline]

Definition at line 307 of file IOobject.H.

const fileName& local (  )  const [inline]

Definition at line 312 of file IOobject.H.

Referenced by IOobject::path(), Foam::ReadFields(), and IOobject::writeHeader().

Here is the caller graph for this function:

Foam::fileName path (  )  const

Return complete path.

Reimplemented in Time.

Definition at line 239 of file IOobject.C.

Referenced by Foam::makeGraph(), IOobject::objectPath(), Foam::operator<<(), surfMesh::removeFiles(), and regIOobject::writeObject().

Here is the caller graph for this function:

Foam::fileName path ( const word instance,
const fileName local = "" 
) const

Return complete path with alternative instance and local.

Definition at line 246 of file IOobject.C.

References IOobject::caseName(), objectRegistry::dbDir(), IOobject::instance(), IOobject::local(), and IOobject::rootPath().

Here is the call graph for this function:

fileName objectPath (  )  const [inline]

Return complete path + object name.

Definition at line 328 of file IOobject.H.

References IOobject::name(), and IOobject::path().

Referenced by regIOobject::write(), and regIOobject::writeObject().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::fileName filePath (  )  const

Return complete path + object name if the file exists.

either in the case/processor or case otherwise null

Definition at line 255 of file IOobject.C.

Referenced by regIOobject::readIfModified(), and regIOobject::readStream().

Here is the caller graph for this function:

bool headerOk (  ) 

Read and check header info.

Definition at line 334 of file IOobject.C.

Referenced by featureEdgeMesh::featureEdgeMesh(), IOField< Type >::IOField(), IOList< T >::IOList(), IOPtrList< T >::IOPtrList(), and Foam::preservePatchTypes().

Here is the caller graph for this function:

Stream & writeBanner ( Stream &  os,
bool  noHint = false 
) [inline, static]

Write the standard OpenFOAM file/dictionary banner.

Optionally without -*- C++ -*- editor hint (eg, for logs)

Definition at line 23 of file IOobjectI.H.

References Foam::FOAMversion.

Referenced by OFSsurfaceFormatCore::writeHeader(), and IOobject::writeHeader().

Here is the caller graph for this function:

Stream & writeDivider ( Stream &  os  )  [inline, static]

Write the standard file section divider.

Definition at line 68 of file IOobjectI.H.

Referenced by OFSsurfaceFormatCore::writeHeader(), IOobject::writeHeader(), and argList::~argList().

Here is the caller graph for this function:

Stream & writeEndDivider ( Stream &  os  )  [inline, static]

Write the standard end file divider.

Definition at line 77 of file IOobjectI.H.

Referenced by regIOobject::writeObject().

Here is the caller graph for this function:

bool writeHeader ( Ostream os  )  const

bool good (  )  const [inline]

Definition at line 372 of file IOobject.H.

Referenced by regIOobject::writeObject().

Here is the caller graph for this function:

bool bad (  )  const [inline]

Definition at line 377 of file IOobject.H.

void operator= ( const IOobject io  ) 

Reimplemented in regIOobject.

Definition at line 394 of file IOobject.C.

References Foam::endl(), IOobject::info(), and Foam::Info.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd