functionObjects: Rationalised use of enumerations by using the C++11 scoped form
This commit is contained in:
@ -94,7 +94,7 @@ Foam::functionObjects::abort::abort
|
||||
functionObject(name),
|
||||
time_(runTime),
|
||||
abortFile_("$FOAM_CASE/" + name),
|
||||
action_(nextWrite)
|
||||
action_(actionType::nextWrite)
|
||||
{
|
||||
abortFile_.expand();
|
||||
read(dict);
|
||||
@ -120,7 +120,7 @@ bool Foam::functionObjects::abort::read(const dictionary& dict)
|
||||
}
|
||||
else
|
||||
{
|
||||
action_ = nextWrite;
|
||||
action_ = actionType::nextWrite;
|
||||
}
|
||||
|
||||
if (dict.readIfPresent("file", abortFile_))
|
||||
@ -141,7 +141,7 @@ bool Foam::functionObjects::abort::execute()
|
||||
{
|
||||
switch (action_)
|
||||
{
|
||||
case noWriteNow :
|
||||
case actionType::noWriteNow :
|
||||
{
|
||||
if (time_.stopAt(Time::saNoWriteNow))
|
||||
{
|
||||
@ -153,7 +153,7 @@ bool Foam::functionObjects::abort::execute()
|
||||
break;
|
||||
}
|
||||
|
||||
case writeNow :
|
||||
case actionType::writeNow :
|
||||
{
|
||||
if (time_.stopAt(Time::saWriteNow))
|
||||
{
|
||||
@ -165,7 +165,7 @@ bool Foam::functionObjects::abort::execute()
|
||||
break;
|
||||
}
|
||||
|
||||
case nextWrite :
|
||||
case actionType::nextWrite :
|
||||
{
|
||||
if (time_.stopAt(Time::saNextWrite))
|
||||
{
|
||||
|
||||
@ -64,7 +64,7 @@ public:
|
||||
// Public data
|
||||
|
||||
//- Enumeration defining the type of action
|
||||
enum actionType
|
||||
enum class actionType
|
||||
{
|
||||
noWriteNow, //!< stop immediately without writing data
|
||||
writeNow, //!< write data and stop immediately
|
||||
|
||||
@ -73,7 +73,7 @@ void Foam::functionObjects::writeObjects::writeObject
|
||||
{
|
||||
switch (writeOption_)
|
||||
{
|
||||
case AUTO_WRITE:
|
||||
case writeOption::AUTO_WRITE:
|
||||
{
|
||||
if(obj.writeOpt() != IOobject::AUTO_WRITE)
|
||||
{
|
||||
@ -82,7 +82,7 @@ void Foam::functionObjects::writeObjects::writeObject
|
||||
|
||||
break;
|
||||
}
|
||||
case NO_WRITE:
|
||||
case writeOption::NO_WRITE:
|
||||
{
|
||||
if(obj.writeOpt() != IOobject::NO_WRITE)
|
||||
{
|
||||
@ -91,7 +91,7 @@ void Foam::functionObjects::writeObjects::writeObject
|
||||
|
||||
break;
|
||||
}
|
||||
case ANY_WRITE:
|
||||
case writeOption::ANY_WRITE:
|
||||
{
|
||||
break;
|
||||
}
|
||||
@ -138,7 +138,7 @@ Foam::functionObjects::writeObjects::writeObjects
|
||||
),
|
||||
log
|
||||
),
|
||||
writeOption_(ANY_WRITE)
|
||||
writeOption_(writeOption::ANY_WRITE)
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
@ -174,7 +174,7 @@ bool Foam::functionObjects::writeObjects::read(const dictionary& dict)
|
||||
}
|
||||
else
|
||||
{
|
||||
writeOption_ = ANY_WRITE;
|
||||
writeOption_ = writeOption::ANY_WRITE;
|
||||
}
|
||||
|
||||
return functionObject::read(dict);
|
||||
|
||||
@ -107,7 +107,7 @@ public:
|
||||
|
||||
//- Re-enumeration defining the write options, based on the original
|
||||
// ones at IOobject::writeOption
|
||||
enum writeOption
|
||||
enum class writeOption
|
||||
{
|
||||
AUTO_WRITE,
|
||||
NO_WRITE,
|
||||
|
||||
Reference in New Issue
Block a user