The destructor class provides a destructor for registered types.
More...
#include <destructor.h>
The destructor class provides a destructor for registered types.
A instance of a destructor class can only be obtained from the type class. See type::get_destructor().
Copying and Assignment
A destructor object is lightweight and can be copied by value. However, each copy will refer to the same underlying destructor.
Typical Usage
The constructor class provides several meta information about a constructor and can be invoked.
Definition: constructor.h:89
variant invoke() const
Invokes the constructor of type returned by get_instantiated_type().
bool invoke(variant &obj) const noexcept
Destroys the contained object in the variant obj.
destructor get_destructor() const noexcept
Returns the corresponding destructor for this type.
static type get() noexcept
Returns a type object for the given template type T.
static type get_by_name(string_view name) noexcept
Returns the type object with the given name name.
constructor get_constructor(const std::vector< type > ¶ms=std::vector< type >()) const noexcept
Returns a public constructor whose parameters match the types in the specified list.
The variant class allows to store data of any type and convert between these types transparently.
Definition: variant.h:198
bool is_valid() const
Returns true if this variant is valid, that means the variant is holding some data.
- See also
- method, property, enumeration, constructor and type
◆ get_declaring_type()
type rttr::destructor::get_declaring_type |
( |
| ) |
const |
|
noexcept |
Returns the class that declares this destructor.
- Returns
- Type of the declaring class/struct for this destructor.
◆ get_destructed_type()
type rttr::destructor::get_destructed_type |
( |
| ) |
const |
|
noexcept |
Returns the rttr::type for which this destructor can delete objects.
- Returns
- The type of this destructor.
◆ invoke()
bool rttr::destructor::invoke |
( |
variant & |
obj | ) |
const |
|
noexcept |
Destroys the contained object in the variant obj
.
- Returns
- True if the destructor of the object could be invoked, otherwise false.
◆ is_valid()
bool rttr::destructor::is_valid |
( |
| ) |
const |
|
noexcept |
Returns true whether this destructor object is valid; otherwise false.
- Returns
- Returns true when the destructor is valid; otherwise false.
◆ operator bool()
rttr::destructor::operator bool |
( |
| ) |
const |
|
explicitnoexcept |
Convenience function to check if this destructor is valid or not.
- Returns
- True if this destructor is valid, otherwise false.
◆ operator!=()
bool rttr::destructor::operator!= |
( |
const destructor & |
other | ) |
const |
|
noexcept |
Returns true if this destructor is the not the same like the other
.
- Returns
- True if both destructors are different, otherwise false.
◆ operator==()
bool rttr::destructor::operator== |
( |
const destructor & |
other | ) |
const |
|
noexcept |
Returns true if this destructor is the same like the other
.
- Returns
- True if both destructors are equal, otherwise false.
The documentation for this class was generated from the following file: