slang/util/Enum.h file

Various enum utilities.

Contents

Namespaces

namespace slang
Root namespace.

Classes

template<typename T>
class slang::bitmask

Defines

#define ENUM(name, elements)
#define ENUM_MEMBER(name, elements)
#define BITMASK(value_type, max_element)

Define documentation

#define ENUM(name, elements)

The ENUM macro defines a strongly-typed enum with the given elements along with a toString() method and an overload of operator<< for formatting.

#define ENUM_MEMBER(name, elements)

The ENUM_MEMBER macro defines a weakly-typed enum with stringification methods similar to ENUM. It is intended to be used for enums that are defined inside a parent class.

#define BITMASK(value_type, max_element)

The BITMASK macro defines convenience operators for a bitmask type. This is to work around strongly typed enums not being combinable by operators like | and & in C++.