expose name of functionObjects

This commit is contained in:
mattijs
2009-07-21 17:28:27 +01:00
parent 18fef89f39
commit dedabab18f
5 changed files with 26 additions and 16 deletions

View File

@ -50,8 +50,7 @@ Foam::OutputFilterFunctionObject<OutputFilter>::OutputFilterFunctionObject
const dictionary& dict const dictionary& dict
) )
: :
functionObject(), functionObject(name),
name_(name),
time_(t), time_(t),
dict_(dict), dict_(dict),
regionName_(polyMesh::defaultRegion), regionName_(polyMesh::defaultRegion),
@ -92,7 +91,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start()
( (
new IOOutputFilter<OutputFilter> new IOOutputFilter<OutputFilter>
( (
name_, name(),
time_.lookupObject<objectRegistry>(regionName_), time_.lookupObject<objectRegistry>(regionName_),
dictName_ dictName_
) )
@ -104,7 +103,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start()
( (
new OutputFilter new OutputFilter
( (
name_, name(),
time_.lookupObject<objectRegistry>(regionName_), time_.lookupObject<objectRegistry>(regionName_),
dict_ dict_
) )

View File

@ -63,9 +63,6 @@ class OutputFilterFunctionObject
{ {
// Private data // Private data
//- Output filter name
word name_;
//- Reference to the time database //- Reference to the time database
const Time& time_; const Time& time_;
@ -121,12 +118,6 @@ public:
// Access // Access
//- Return name
virtual const word& name() const
{
return name_;
}
//- Return time database //- Return time database
virtual const Time& time() const virtual const Time& time() const
{ {

View File

@ -36,7 +36,9 @@ int Foam::functionObject::debug(Foam::debug::debugSwitch("functionObject", 0));
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObject::functionObject() Foam::functionObject::functionObject(const word& name)
:
name_(name)
{} {}
@ -103,6 +105,12 @@ Foam::functionObject::~functionObject()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::word& Foam::functionObject::name() const
{
return name_;
}
bool Foam::functionObject::end() bool Foam::functionObject::end()
{ {
return execute(); return execute();

View File

@ -57,6 +57,12 @@ class Time;
class functionObject class functionObject
{ {
// Private data
//- Name
const word name_;
// Private Member Functions // Private Member Functions
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
@ -88,8 +94,8 @@ public:
// Constructors // Constructors
//- Construct null //- Construct from components
functionObject(); functionObject(const word& name);
//- Return clone //- Return clone
autoPtr<functionObject> clone() const autoPtr<functionObject> clone() const
@ -137,6 +143,9 @@ public:
// Member Functions // Member Functions
//- Name
virtual const word& name() const;
//- Called at the start of the time-loop //- Called at the start of the time-loop
virtual bool start() = 0; virtual bool start() = 0;

View File

@ -133,6 +133,9 @@ public:
//- Return true if the List is empty (ie, size() is zero). //- Return true if the List is empty (ie, size() is zero).
using PtrList<functionObject>::empty; using PtrList<functionObject>::empty;
//- Access to the functionObjects
using PtrList<functionObject>::operator[];
//- Clear the list of function objects //- Clear the list of function objects
virtual void clear(); virtual void clear();