ADTF
|
Object pointer implementation used for reference counting on objects of type IObject. More...
Public Member Functions | |
object_ptr () | |
Default constructor - the object_ptr<T> is created empty. | |
virtual | ~object_ptr ()=default |
default destruction | |
object_ptr (std::nullptr_t) | |
nullptr_t construction - the object_ptr<T> is created empty | |
object_ptr (const object_ptr &i_oOther) | |
Copy constructor. More... | |
object_ptr (const iobject_ptr< T > &i_oOther) | |
Copy constructor for base type. More... | |
template<typename U > | |
object_ptr (const iobject_ptr< U > &i_oOther) | |
Copy constructor for iobject_ptr containing a different type. More... | |
template<typename U > | |
object_ptr (const iobject_ptr< U > &i_oOther, T *pSharedObject) | |
Aliasing constructor for iobject_ptr containing a different type. More... | |
object_ptr (object_ptr &&i_oOther) | |
Move constructor. More... | |
template<typename U > | |
object_ptr (const weak_object_ptr< U > &i_pWeak) | |
Construct from weak_object_ptr<> More... | |
object_ptr & | operator= (object_ptr i_oOther) |
Assignment operator. More... | |
template<typename U > | |
object_ptr & | operator= (const object_ptr< U > &i_oOther) |
Assignment operator for object_ptr containing a different type. More... | |
T & | operator* () const |
Operator* overload to treat object_ptr<> types like real pointers. More... | |
operator bool () const | |
Conversion to bool. More... | |
void | Reset () |
Reset this object_ptr . More... | |
void | Swap (object_ptr &o_oOther) |
Swap content of *this with o_oOther (only shallow copies are performed!) More... | |
virtual T * | Get () const |
Get pointer to shared object. More... | |
virtual T * | operator-> () const |
Operator-> overload to treat object_ptr<> types like real pointers. More... | |
virtual tResult | Reset (const iobject_ptr< T > &i_oOther) |
Reset this object_ptr<> with the content of another iobject_ptr<> More... | |
Object pointer implementation used for reference counting on objects of type IObject.
To pass reference counted objects between binary boundaries the iobject_ptr is provided. This object_ptr
implements the interface of iobject_ptr
and can thus be used to manage pointers to concrete implementations of IObject types. In particular two implicit conversions of object_ptr<T>
are available: The first one being to iobject_ptr<T>
due to its inheritance. The second one being to iobject_ptr<IObject>&
or const
iobject_ptr<IObject>
to address the frequent calls to excatly these types in provided interfaces.
T | Concrete type derived from IObject. If the type doesn't implement ADTF_IID(), no implicit conversion to the non const version of base type iobject_ptr<IObject> is available. |
object_ptr
with a concrete object of type T
is to use free function make_object_ptr()
. Definition at line 162 of file object_ptr.h.
|
inline |
Copy constructor.
[in] | i_oOther | object_ptr to create this from. Reference count is increased by one |
Definition at line 250 of file object_ptr.h.
|
inline |
Copy constructor for base type.
[in] | i_oOther | iobject_ptr to create this from. Reference count is increased by one |
Definition at line 259 of file object_ptr.h.
|
inline |
Copy constructor for iobject_ptr containing a different type.
U | Contained type of i_oOther that must be castable using ucom_cast<> to type T |
[in] | i_oOther | iobject_ptr to create this from. Reference count will be increased by one |
Definition at line 270 of file object_ptr.h.
|
inline |
Aliasing constructor for iobject_ptr containing a different type.
U | Contained type of i_oOther that must be castable using ucom_cast<> to type T |
[in] | i_oOther | iobject_ptr to create this from. Reference count will be increased by one |
[in] | pSharedObject | Pointer to the actual shared object |
Definition at line 282 of file object_ptr.h.
|
inline |
Move constructor.
[in] | i_oOther | object_ptr to create this from. Will be reset. |
Definition at line 291 of file object_ptr.h.
References object_ptr< T >::Swap().
|
inline |
Construct from weak_object_ptr<>
U | Type of the managed resource by the weak_ptr . Must be implicitely castable to type T . |
[in] | i_pWeak | weak pointer object to create *this from. |
i_pWeak
holds a valid reference to the shared resource, the shared count is increased by one. There is no effect on the weak count. Definition at line 305 of file object_ptr.h.
|
inlinevirtual |
Get pointer to shared object.
Definition at line 381 of file object_ptr.h.
Referenced by adtf::streaming::devil::add_graph_object(), object_ptr< T >::operator bool(), object_ptr< T >::operator*(), object_ptr_locked_common< T >::operator->(), object_ptr< T >::operator->(), and property< T >::Set().
|
inlineexplicit |
Conversion to bool.
Definition at line 350 of file object_ptr.h.
References object_ptr< T >::Get().
|
inline |
Operator* overload to treat object_ptr<> types like real pointers.
Definition at line 341 of file object_ptr.h.
References object_ptr< T >::Get().
|
inlinevirtual |
Operator-> overload to treat object_ptr<> types like real pointers.
Definition at line 390 of file object_ptr.h.
References object_ptr< T >::Get().
|
inline |
Assignment operator for object_ptr containing a different type.
U | Contained type of i_oOther that must be castable using ucom_cast<> to type T |
[in] | i_oOther | object_ptr to create this from. Reference count will be increased by one |
Definition at line 331 of file object_ptr.h.
|
inline |
Assignment operator.
[in] | i_oOther | Other object_ptr<> to create this from. Call-by-value is intentional to make use of the copy-swap-idiom and the copy elision. |
nullptr
, the shared count of the reference counting object gets increased by one. Definition at line 318 of file object_ptr.h.
References object_ptr< T >::Swap().
|
inline |
Reset this object_ptr
.
!static_cast<bool>(*this);
Definition at line 361 of file object_ptr.h.
References object_ptr< T >::object_ptr().
Referenced by cSampleWriter::EndStreaming(), adtf::services::ant::get_recorder(), sample_data< T >::Reset(), sample_data< T, Enable >::Reset(), and cStreamItem::SetSample().
|
inlinevirtual |
Reset this object_ptr<> with the content of another iobject_ptr<>
[in] | i_oOther | Contains the shared object to reset this type with |
ERR_NOERROR | Everything went fine |
Definition at line 402 of file object_ptr.h.
|
inline |
Swap content of *this with o_oOther
(only shallow copies are performed!)
[in,out] | o_oOther | Other object_ptr object whose content is swapped with *this. |
Definition at line 371 of file object_ptr.h.
Referenced by object_ptr< T >::object_ptr(), and object_ptr< T >::operator=().