dynamicCode: the "code" entry is now optional

codedFunctionObject: Added the "codeWrite" entry
    for the "write" function for consistency.
    The previous method of using the "code" entry for the "write"
    function was inconsistent and very confusing.
This commit is contained in:
Henry Weller
2016-05-18 12:20:03 +01:00
parent 2b501b7e85
commit 354bc8bdcb
7 changed files with 70 additions and 100 deletions

View File

@ -136,6 +136,21 @@ bool ${typeName}FunctionObject::execute(const bool postProcess)
}
bool ${typeName}FunctionObject::write(const bool postProcess)
{
if (${verbose:-false})
{
Info<<"write ${typeName} sha1: ${SHA1sum}\n";
}
//{{{ begin code
${codeWrite}
//}}} end code
return true;
}
bool ${typeName}FunctionObject::end()
{
if (${verbose:-false})
@ -151,36 +166,6 @@ bool ${typeName}FunctionObject::end()
}
bool ${typeName}FunctionObject::timeSet()
{
if (${verbose:-false})
{
Info<<"timeSet ${typeName} sha1: ${SHA1sum}\n";
}
//{{{ begin codeTime
${codeTimeSet}
//}}} end code
return true;
}
bool ${typeName}FunctionObject::write(const bool postProcess)
{
if (${verbose:-false})
{
Info<<"write ${typeName} sha1: ${SHA1sum}\n";
}
//{{{ begin code
${code}
//}}} end code
return true;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -107,9 +107,6 @@ public:
//- Write, execute the "writeCalls"
virtual bool write(const bool postProcess = false);
//- Called when time was set at the end of the Time::operator++
virtual bool timeSet();
};