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
)
:
functionObject(),
name_(name),
functionObject(name),
time_(t),
dict_(dict),
regionName_(polyMesh::defaultRegion),
@ -92,7 +91,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start()
(
new IOOutputFilter<OutputFilter>
(
name_,
name(),
time_.lookupObject<objectRegistry>(regionName_),
dictName_
)
@ -104,7 +103,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start()
(
new OutputFilter
(
name_,
name(),
time_.lookupObject<objectRegistry>(regionName_),
dict_
)

View File

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

View File

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

View File

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

View File

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