Registrar#
Fully qualified name: carb::variant::Registrar
Defined in carb/variant/VariantUtils.h
- 
class Registrar#
 Lifetime management wrapper for IVariant::registerType().
Public Functions
- 
constexpr Registrar() noexcept#
 Default constructor.
Constructs an empty registrar.
- 
Registrar(const VTable *vtable) noexcept#
 Constructor.
Registers the type.
See also
Note
If registration fails, isEmpty() will return
true.- Parameters:
 vtable – The v-table pointer to register.
- 
Registrar(Registrar &&other) noexcept#
 Move-construct.
Moves the registered type to
*thisand leavesotherempty.- Parameters:
 other – The other Registrar to move from.
- 
Registrar &operator=(Registrar &&other) noexcept#
 Move-assign.
Swaps state with
other.- Parameters:
 other – The other Registrar to swap state with.
- Returns:
 *this
- 
bool isEmpty() const noexcept#
 Checks whether
*thisis empty.- Returns:
 trueif*thisdoes not contain a valid type;falseotherwise.
- 
RString getType() const noexcept#
 Retrieves the registered type.
- Returns:
 The managed type, or an empty
RStringif*thisis empty and no type is managed.
- 
void reset() noexcept#
 Resets
*thisto an empty state, unregistering any registered type.
- 
constexpr Registrar() noexcept#