View on GitHub

Vistle

Distributed Data-parallel Scientific Visualization in VR

Macros
enum.h File Reference
#include <vector>
#include <string>
#include <boost/preprocessor.hpp>
Include dependency graph for enum.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define X_DEFINE_ENUM_WITH_STRING_CONVERSIONS_TOSTRING_CASE(r, data, elem)
 
#define X_DEFINE_ENUM_FOR_PYTHON_VALUE(r, data, elem)   .value(BOOST_PP_STRINGIZE(elem), elem)
 
#define X_DEFINE_ENUM_ADD_VALUE(r, data, elem)   values.emplace_back(BOOST_PP_STRINGIZE(elem));
 
#define DEFINE_ENUM_WITH_STRING_CONVERSIONS(name, enumerators)
 
#define V_ENUM_OUTPUT_OP(name, scope)
 
#define V_ENUM_SET_CHOICES_SCOPE(param, name, scope)   setParameterChoices(param, scope::valueList((scope::name)0))
 
#define V_ENUM_SET_CHOICES(param, name)   setParameterChoices(param, valueList((name)0))
 

Macro Definition Documentation

◆ DEFINE_ENUM_WITH_STRING_CONVERSIONS

#define DEFINE_ENUM_WITH_STRING_CONVERSIONS (   name,
  enumerators 
)
Value:
enum name { BOOST_PP_SEQ_ENUM(enumerators) }; \
\
static inline const char *toString(name v) \
{ \
switch (v) { \
BOOST_PP_SEQ_FOR_EACH(X_DEFINE_ENUM_WITH_STRING_CONVERSIONS_TOSTRING_CASE, name, enumerators) \
default: \
return "[Unknown " BOOST_PP_STRINGIZE(name) "]"; \
} \
} \
\
static inline std::vector<std::string> valueList(name) \
{ \
std::vector<std::string> values; \
BOOST_PP_SEQ_FOR_EACH(X_DEFINE_ENUM_ADD_VALUE, name, enumerators) \
return values; \
}
#define X_DEFINE_ENUM_ADD_VALUE(r, data, elem)
Definition: enum.h:22
#define X_DEFINE_ENUM_WITH_STRING_CONVERSIONS_TOSTRING_CASE(r, data, elem)
Definition: enum.h:16

◆ V_ENUM_OUTPUT_OP

#define V_ENUM_OUTPUT_OP (   name,
  scope 
)
Value:
inline std::ostream &operator<<(std::ostream &s, scope::name v) \
{ \
s << scope::toString(v) << " (" << (int)v << ")"; \
return s; \
}
V_COREEXPORT std::ostream & operator<<(std::ostream &s, const Message &msg)
Definition: messages.cpp:1718

◆ V_ENUM_SET_CHOICES

#define V_ENUM_SET_CHOICES (   param,
  name 
)    setParameterChoices(param, valueList((name)0))

◆ V_ENUM_SET_CHOICES_SCOPE

#define V_ENUM_SET_CHOICES_SCOPE (   param,
  name,
  scope 
)    setParameterChoices(param, scope::valueList((scope::name)0))

◆ X_DEFINE_ENUM_ADD_VALUE

#define X_DEFINE_ENUM_ADD_VALUE (   r,
  data,
  elem 
)    values.emplace_back(BOOST_PP_STRINGIZE(elem));

◆ X_DEFINE_ENUM_FOR_PYTHON_VALUE

#define X_DEFINE_ENUM_FOR_PYTHON_VALUE (   r,
  data,
  elem 
)    .value(BOOST_PP_STRINGIZE(elem), elem)

◆ X_DEFINE_ENUM_WITH_STRING_CONVERSIONS_TOSTRING_CASE

#define X_DEFINE_ENUM_WITH_STRING_CONVERSIONS_TOSTRING_CASE (   r,
  data,
  elem 
)
Value:
case elem: \
return BOOST_PP_STRINGIZE(elem);