![]() |
TSDuck v3.45-4686
MPEG Transport Stream Toolkit
|
General-purpose base class for objects with an "owner". More...
#include <tsOwnedObject.h>


Public Member Functions | |
| OwnedObject (Object *owner=nullptr) | |
| Constructor. | |
| virtual | ~OwnedObject () override |
| Destructor. | |
| bool | isOwned () |
| Check if the object is owned. | |
| template<class OBJECT > requires std::derived_from<OBJECT, ts::Object> | |
| bool | isOwned () |
| Check if the object is owned by an object of a given type. | |
| Object * | owner () |
| Get the address of the optional "owner" object which was specified in the constructor. | |
| template<class OBJECT > requires std::derived_from<OBJECT, ts::Object> | |
| OBJECT * | owner () |
| Get the address of the "owner" object which was specified in the constructor. | |
General-purpose base class for objects with an "owner".
An object A is "owned" when we associate this object with an "owner" object B during the contruction of A. This association cannot be modified. Typically, A is a member of B and B always has a (slightly) longer lifetime than A.
|
inline |
Constructor.
| [in] | owner | Optional address of an "owner" object, typically an instance of class containing this object. |
|
inline |
Get the address of the optional "owner" object which was specified in the constructor.
|
inline |
Check if the object is owned.
| OBJECT * ts::OwnedObject::owner | ( | ) |
Get the address of the "owner" object which was specified in the constructor.
This template version requires that the owner objet is set and of type OBJECT, or some subclass of it. If there is no owner object or if it is not compatible with the template class OBJECT, this is a fatal error and the application is terminated.
| OBJECT | A subclass of Object |
|
inline |
Check if the object is owned by an object of a given type.
| OBJECT | A subclass of Object |