mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: upgrade from NamedEnum to Enum (issue #515)
This commit is contained in:
@ -27,23 +27,17 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::volumeType
|
||||
>
|
||||
Foam::volumeType::names
|
||||
{
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::volumeType,
|
||||
4
|
||||
>::names[] =
|
||||
{
|
||||
"unknown",
|
||||
"mixed",
|
||||
"inside",
|
||||
"outside"
|
||||
};
|
||||
}
|
||||
|
||||
const Foam::NamedEnum<Foam::volumeType, 4> Foam::volumeType::names;
|
||||
{ type::UNKNOWN, "unknown" },
|
||||
{ type::MIXED, "mixed" },
|
||||
{ type::INSIDE, "inside" },
|
||||
{ type::OUTSIDE, "outside" },
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
@ -34,7 +34,7 @@ SourceFiles
|
||||
#ifndef volumeType_H
|
||||
#define volumeType_H
|
||||
|
||||
#include "NamedEnum.H"
|
||||
#include "Enum.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -44,8 +44,8 @@ namespace Foam
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
class volumeType;
|
||||
Istream& operator>>(Istream& is, volumeType&);
|
||||
Ostream& operator<<(Ostream& os, const volumeType& C);
|
||||
Istream& operator>>(Istream& is, volumeType& vt);
|
||||
Ostream& operator<<(Ostream& os, const volumeType& vt);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -65,6 +65,9 @@ public:
|
||||
OUTSIDE = 3
|
||||
};
|
||||
|
||||
// Static data
|
||||
static const Enum<volumeType> names;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@ -76,11 +79,6 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
// Static data
|
||||
|
||||
static const NamedEnum<volumeType, 4> names;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
|
||||
Reference in New Issue
Block a user