RDKit: better_enums Namespace Reference

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Classes | Functions | Variables
better_enums Namespace Reference

## Classes
struct | _eat_assign
| Get intrinsic value of an (Enum::value) by taking advantage of. More...
struct | _initialize_at_program_start
struct | _iterable
struct | map
struct | map_compare
struct | map_compare< const char * >
struct | map_compare< const wchar_t * >
struct | optional

## Functions
template<typename T>
BETTER_ENUMS_CONSTEXPR_ T | _default ()
template<>
BETTER_ENUMS_CONSTEXPR_ const char * | _default< const char * > ()
template<>
BETTER_ENUMS_CONSTEXPR_ std::size_t | _default< std::size_t > ()
template<typename CastTo, typename Element>
static BETTER_ENUMS_CONSTEXPR_ optional< CastTo > | _map_index (const Element *array, optional< std::size_t > index)
| BETTER_ENUMS_IF_EXCEPTIONS (template< typename T > BETTER_ENUMS_CONSTEXPR_ static T _or_throw(optional< T > maybe, const char *message) { BETTER_ENUMS_OR_THROW }) template< typename T > BETTER_ENUMS_CONSTEXPR_ static T *_or_null(optional< T * > maybe)
template<typename T>
static BETTER_ENUMS_CONSTEXPR_ T | _or_zero (optional< T > maybe)
template<typename T, typename U>
BETTER_ENUMS_CONSTEXPR_ U | continue_with (T, U value)
BETTER_ENUMS_CONSTEXPR_ bool | _ends_name (char c, std::size_t index=0)
BETTER_ENUMS_CONSTEXPR_ bool | _has_initializer (const char *s, std::size_t index=0)
BETTER_ENUMS_CONSTEXPR_ std::size_t | _constant_length (const char *s, std::size_t index=0)
BETTER_ENUMS_CONSTEXPR_ char | _select (const char *from, std::size_t from_length, std::size_t index)
BETTER_ENUMS_CONSTEXPR_ char | _to_lower_ascii (char c)
BETTER_ENUMS_CONSTEXPR_ bool | _names_match (const char *stringizedName, const char *referenceName, std::size_t index=0)
BETTER_ENUMS_CONSTEXPR_ bool | _names_match_nocase (const char *stringizedName, const char *referenceName, std::size_t index=0)
void | _trim_names (const char *const *raw_names, const char **trimmed_names, char *storage, std::size_t count)
template<typename Enum, typename T>
BETTER_ENUMS_CONSTEXPR_ map< Enum, T > | make_map (T(*f)(Enum))

## Variables
static BETTER_ENUMS_CONSTEXPR_ const char * | _name_enders = "= \t\n"

## Function Documentation

## ◆ _constant_length()

BETTER_ENUMS_CONSTEXPR_ std::size_t better_enums::_constant_length | ( | const char * | s,
|  | std::size_t | index = 0 )
| inline

Definition at line 473 of file enum.h.

References _constant_length(), and _ends_name().

Referenced by _constant_length().

## ◆ _default()

template<typename T>

BETTER_ENUMS_CONSTEXPR_ T better_enums::_default | ( |  | ) |
| inline

Definition at line 315 of file enum.h.

References BETTER_ENUMS_CONSTEXPR_.

Referenced by better_enums::optional< T >::optional().

## ◆ _default< const char * >()

template<>

BETTER_ENUMS_CONSTEXPR_ const char * better_enums::_default< const char * > | ( |  | ) |
| inline

Definition at line 321 of file enum.h.

References BETTER_ENUMS_CONSTEXPR_, and BETTER_ENUMS_NULLPTR.

## ◆ _default< std::size_t >()

template<>

BETTER_ENUMS_CONSTEXPR_ std::size_t better_enums::_default< std::size_t > | ( |  | ) |
| inline

Definition at line 327 of file enum.h.

References BETTER_ENUMS_CONSTEXPR_.

## ◆ _ends_name()

BETTER_ENUMS_CONSTEXPR_ bool better_enums::_ends_name | ( | char | c,
|  | std::size_t | index = 0 )
| inline

Definition at line 455 of file enum.h.

References _ends_name(), _name_enders, and BETTER_ENUMS_CONSTEXPR_.

Referenced by _constant_length(), _ends_name(), _names_match(), and _names_match_nocase().

## ◆ _has_initializer()

BETTER_ENUMS_CONSTEXPR_ bool better_enums::_has_initializer | ( | const char * | s,
|  | std::size_t | index = 0 )
| inline

Definition at line 463 of file enum.h.

References _has_initializer(), and BETTER_ENUMS_CONSTEXPR_.

Referenced by _has_initializer().

## ◆ _map_index()

template<typename CastTo, typename Element>

static BETTER_ENUMS_CONSTEXPR_ optional< CastTo > better_enums::_map_index | ( | const Element * | array,
|  | optional< std::size_t > | index )
| static

Definition at line 353 of file enum.h.

## ◆ _names_match()

BETTER_ENUMS_CONSTEXPR_ bool better_enums::_names_match | ( | const char * | stringizedName,
|  | const char * | referenceName,
|  | std::size_t | index = 0 )
| inline

Definition at line 489 of file enum.h.

References _ends_name(), _names_match(), and BETTER_ENUMS_CONSTEXPR_.

Referenced by _names_match().

## ◆ _names_match_nocase()

BETTER_ENUMS_CONSTEXPR_ bool better_enums::_names_match_nocase | ( | const char * | stringizedName,
|  | const char * | referenceName,
|  | std::size_t | index = 0 )
| inline

Definition at line 501 of file enum.h.

References _ends_name(), _names_match_nocase(), and _to_lower_ascii().

Referenced by _names_match_nocase().

## ◆ _or_zero()

template<typename T>

static BETTER_ENUMS_CONSTEXPR_ T better_enums::_or_zero | ( | optional< T > | maybe | ) |
| static

Definition at line 389 of file enum.h.

References BETTER_ENUMS_CONSTEXPR_.

## ◆ _select()

BETTER_ENUMS_CONSTEXPR_ char better_enums::_select | ( | const char * | from,
|  | std::size_t | from_length,
|  | std::size_t | index )
| inline

Definition at line 479 of file enum.h.

## ◆ _to_lower_ascii()

BETTER_ENUMS_CONSTEXPR_ char better_enums::_to_lower_ascii | ( | char | c | ) |
| inline

Definition at line 484 of file enum.h.

References BETTER_ENUMS_CONSTEXPR_.

Referenced by _names_match_nocase().

## ◆ _trim_names()

void better_enums::_trim_names | ( | const char *const * | raw_names,
|  | const char ** | trimmed_names,
|  | char * | storage,
|  | std::size_t | count )
| inline

Definition at line 512 of file enum.h.

References _name_enders.

## ◆ BETTER_ENUMS_IF_EXCEPTIONS()

better_enums::BETTER_ENUMS_IF_EXCEPTIONS | ( | template< typename T > BETTER_ENUMS_CONSTEXPR_ static T _or_throw(optional< T > maybe, const char *message) { BETTER_ENUMS_OR_THROW } |  | ) |

Definition at line 373 of file enum.h.

References BETTER_ENUMS_CONSTEXPR_, and BETTER_ENUMS_OR_THROW.

## ◆ continue_with()

template<typename T, typename U>

BETTER_ENUMS_CONSTEXPR_ U better_enums::continue_with | ( | T | ,
|  | U | value )

Definition at line 403 of file enum.h.

## ◆ make_map()

template<typename Enum, typename T>

BETTER_ENUMS_CONSTEXPR_ map< Enum, T > better_enums::make_map | ( | T(* | f )(Enum) | ) |

Definition at line 1308 of file enum.h.

References BETTER_ENUMS_CONSTEXPR_.

## Variable Documentation

## ◆ _name_enders

BETTER_ENUMS_CONSTEXPR_ const char* better_enums::_name_enders = "= \t\n"
| static

Definition at line 453 of file enum.h.

Referenced by _ends_name(), and _trim_names().