Contains the declarations of a base class for all TL-objects and some helper methods
Go to the source code of this file.
Classes | |
class | TlObject |
Typedefs | |
template<class Type > | |
using | tl_object_ptr = tl::unique_ptr< Type > |
Functions | |
template<class Type , class... Args> | |
tl_object_ptr< Type > | make_tl_object (Args &&...args) |
template<class ToT , class FromT > | |
tl_object_ptr< ToT > | move_tl_object_as (tl_object_ptr< FromT > &from) |
template<class ToT , class FromT > | |
tl_object_ptr< ToT > | move_tl_object_as (tl_object_ptr< FromT > &&from) |
using tl_object_ptr = tl::unique_ptr<Type> |
A smart wrapper to store a pointer to a TL-object.
tl_object_ptr<Type> td::make_tl_object | ( | Args &&... | args | ) |
A function to create a dynamically allocated TL-object. Can be treated as an analogue of std::make_unique. Usage example:
Type | Type of the TL-object to construct. |
[in] | args | Arguments to pass to the object constructor. |
tl_object_ptr<ToT> td::move_tl_object_as | ( | tl_object_ptr< FromT > & | from | ) |
A function to downcast a wrapped pointer to a TL-object to a pointer to its subclass. Casting an object to an incorrect type will lead to undefined behaviour. Examples of usage:
ToT | Type of TL-object to move to. |
FromT | Type of TL-object to move from, this is auto-deduced. |
[in] | from | Wrapped pointer to a TL-object. |
tl_object_ptr<ToT> td::move_tl_object_as | ( | tl_object_ptr< FromT > && | from | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.