ENH: upgrade from NamedEnum to Enum (issue #515)

This commit is contained in:
Mark Olesen
2017-07-03 21:43:33 +02:00
parent 575073890f
commit f55c568f13
179 changed files with 1595 additions and 2035 deletions

View File

@ -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 * * * * * * * * * * * * //

View File

@ -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