Type‐erased non‐const reference to an object in the bdlat enumeration type category.

Synopsis

Declared in <bdlar_enumref.h>

class EnumRef;

Member Functions

Name

Description

EnumRef [constructor]

Constructors

fromInt

Assign the enumerator value matching the specified number. Return 0 on success, and a non‐zero value with no effect on the object if number does not match any enumerator.

fromString

Assign the enumerator value matching the specified string of the specified stringLength. Return 0 on success, and a non‐zero value with no effect on the object if string and stringLength do not match any enumerator.

hasFallback

Return true if the specified enumerator held by this object supports a fallback enumerator, and false otherwise.

isFallback

Return true if the specified enumerator held by this object is equal to a fallback enumerator, and false otherwise.

makeFallback

Assign the fallback enumerator value. Return 0 on success, and a non‐zero value with no effect on the object if it does not have a fallback enumerator.

objectAddress

Return a pointer to the wrapped object.

reset

Reset the referred object to the default value.

toInt

Load into the specified result the integer representation of the enumerator value held by this object.

toString

Load into the specified result the string representation of the enumerator value held by this object.

vtable

Return a pointer to the vtable.

Non-Member Functions

Name

Description

bdlat_enumFromInt

Assign the enumerator value matching the specified number to the specified result. Return 0 on success, and a non‐zero value with no effect on the object if number does not match any enumerator.

bdlat_enumFromString

Assign the enumerator value matching the specified string of the specified stringLength to the specified result. Return 0 on success, and a non‐zero value with no effect on the object if string and stringLength do not match any enumerator.

bdlat_enumHasFallback

Return true if the specified value supports a fallback enumerator, and false otherwise.

bdlat_enumIsFallback

Return true if the specified value is a fallback enumerator.

bdlat_enumMakeFallback

Assign the fallback enumerator value to the specified result. Return 0 on success, and a non‐zero value with no effect on the object if it does not have a fallback enumerator.

bdlat_valueTypeReset

Reset the specified ref to the default value.

Created with MrDocs