FEDEM Solver  R8.0
Source code of the dynamics solver
Classes | Macros | Functions
FFaEnum.H File Reference

Enum variables with text representations. More...

#include <vector>
#include <utility>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <iostream>
Include dependency graph for FFaEnum.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  FFaEnum< EnumType, ETMapping >
 Class to be used as a enum variable with text representations. More...
 

Macros

#define FFaEnumMapping(EnumType)
 Defines the start of an enum mapping definition. More...
 
#define FFaEnumEntry(EnumValue, EnumText)    enumMap.push_back(std::make_pair(EnumValue,EnumText));
 Adds one entry to the current enum mapping definition. More...
 
#define FFaEnumEntryEnd    } return enumMap; }
 Defines the end of an enum mapping definition. More...
 

Functions

template<class EnumType , class ETMapping >
std::ostream & operator<< (std::ostream &s, const FFaEnum< EnumType, ETMapping > &e)
 Global output stream operator. More...
 
template<class EnumType , class ETMapping >
std::istream & operator>> (std::istream &s, FFaEnum< EnumType, ETMapping > &e)
 Global input stream operator. More...
 

Detailed Description

Enum variables with text representations.

Macro Definition Documentation

◆ FFaEnumEntry

#define FFaEnumEntry (   EnumValue,
  EnumText 
)     enumMap.push_back(std::make_pair(EnumValue,EnumText));

Adds one entry to the current enum mapping definition.

◆ FFaEnumEntryEnd

#define FFaEnumEntryEnd    } return enumMap; }

Defines the end of an enum mapping definition.

◆ FFaEnumMapping

#define FFaEnumMapping (   EnumType)
Value:
class EnumType##Mapping; \
typedef FFaEnum<EnumType,EnumType##Mapping> EnumType##Enum; \
class EnumType##Mapping \
{ \
typedef std::pair<EnumType,const char*> EnumType##Pair; \
public: \
static const std::vector<EnumType##Pair> map() \
{ \
std::vector<EnumType##Pair> enumMap; \
if (enumMap.empty())
Class to be used as a enum variable with text representations.
Definition: FFaEnum.H:87

Defines the start of an enum mapping definition.

Function Documentation

◆ operator<<()

template<class EnumType , class ETMapping >
std::ostream& operator<< ( std::ostream &  s,
const FFaEnum< EnumType, ETMapping > &  e 
)

Global output stream operator.

◆ operator>>()

template<class EnumType , class ETMapping >
std::istream& operator>> ( std::istream &  s,
FFaEnum< EnumType, ETMapping > &  e 
)

Global input stream operator.