ATLAS Offline Software
|
Pointer to objects managed by ObjContainer. More...
#include <ObjContainer.h>
Public Member Functions | |
ObjPtr ()=default | |
ObjPtr (ObjPtr &&obj_ptr)=default | |
ObjPtr (const ObjPtr &obj_ptr) | |
ObjPtr (ObjContainer< T_Obj > &container, const T_Obj &obj) | |
Store an external object in the container. More... | |
ObjPtr (ObjContainer< T_Obj > &container, std::unique_ptr< T_Obj > obj) | |
Pass a unique_ptr to the container The Unique_ptr becomes an Owned object i.e has count 1. More... | |
ObjPtr (ObjContainer< T_Obj > &container, ObjRef ref=ObjRef()) | |
Share the referred object managed by the given container. More... | |
~ObjPtr () noexcept(false) | |
operator bool () const | |
Test whether this pointer points to a valid object. More... | |
ObjPtr & | operator= (const ObjPtr &obj) |
ObjPtr & | operator= (ObjPtr &&obj) |
ObjPtr & | operator= (ObjRef ref) |
bool | operator== (const ObjPtr &obj) const |
Test whether two pointer point to the same object. More... | |
bool | operator!= (const ObjPtr &obj) const |
Test whether two pointer point to different objects. More... | |
T_Obj & | operator* () |
T_Obj * | operator-> () |
T_Obj * | get () |
Get a pointer to a valid manged object. More... | |
const T_Obj * | get () const |
Get a const pointer to a valid manged object. More... | |
T_Obj * | release () |
Release the object this pointer points to from the container. More... | |
std::unique_ptr< T_Obj > | to_unique () |
Release the object this pointer points to from the container. More... | |
ObjRef | index () const |
Get a light-weight reference to the object pointed to by this pointer The returned light-weight reference does not provide any lifetime guarantees of the object. More... | |
bool | isOwned () const |
Return true if the object is managed and owned by the container. More... | |
bool | isShared () const |
Return true if the object is managed by the container and if there are more than one instances of ObjPtr which point to this object. More... | |
bool | isExtern () const |
Return true if the object is an external object i.e. More... | |
Protected Member Functions | |
void | shareAndSet (ObjRef ref) |
Helper method to increase the share count of the referenced object and point to that object. More... | |
Private Attributes | |
ObjContainer< T_Obj > * | m_container = nullptr |
pointer to the conainer More... | |
ObjRef | m_ref {} |
a valid reference to an object stored in the container or an invalid reference. More... | |
Pointer to objects managed by ObjContainer.
Definition at line 33 of file ObjContainer.h.
Definition at line 477 of file ObjContainer.h.
|
inline |
Store an external object in the container.
container | the container to store the given object |
obj | the external object to be stored in the container. The container will not claim ownership. |
Definition at line 488 of file ObjContainer.h.
|
inline |
Pass a unique_ptr to the container The Unique_ptr becomes an Owned object i.e has count 1.
container | the container to store the given object |
obj | the object to be managed. |
Definition at line 501 of file ObjContainer.h.
|
inline |
Share the referred object managed by the given container.
container | the container which manages the referenced object. |
ref | a reference to an object in the container (or an invalid reference) to create on invalid ObjPtr. |
Definition at line 509 of file ObjContainer.h.
Definition at line 514 of file ObjContainer.h.
|
inline |
Get a pointer to a valid manged object.
will | throw an exception if this pointer does not point to a valid object. |
Definition at line 588 of file ObjContainer.h.
Get a const pointer to a valid manged object.
will | throw an exception if this pointer does not point to a valid object. |
Definition at line 598 of file ObjContainer.h.
Get a light-weight reference to the object pointed to by this pointer The returned light-weight reference does not provide any lifetime guarantees of the object.
Definition at line 629 of file ObjContainer.h.
|
inline |
Return true if the object is an external object i.e.
if the container does not have ownership over this object.
Definition at line 660 of file ObjContainer.h.
|
inline |
Return true if the object is managed and owned by the container.
Definition at line 648 of file ObjContainer.h.
|
inline |
Return true if the object is managed by the container and if there are more than one instances of ObjPtr which point to this object.
Definition at line 654 of file ObjContainer.h.
|
inline |
Test whether two pointer point to different objects.
Definition at line 573 of file ObjContainer.h.
|
inline |
Definition at line 577 of file ObjContainer.h.
|
inline |
Definition at line 581 of file ObjContainer.h.
Definition at line 524 of file ObjContainer.h.
Definition at line 538 of file ObjContainer.h.
Definition at line 552 of file ObjContainer.h.
Test whether two pointer point to the same object.
Definition at line 567 of file ObjContainer.h.
|
inline |
Release the object this pointer points to from the container.
Definition at line 610 of file ObjContainer.h.
Helper method to increase the share count of the referenced object and point to that object.
Definition at line 635 of file ObjContainer.h.
|
inline |
Release the object this pointer points to from the container.
Definition at line 622 of file ObjContainer.h.
|
private |
pointer to the conainer
Definition at line 666 of file ObjContainer.h.
a valid reference to an object stored in the container or an invalid reference.
Definition at line 667 of file ObjContainer.h.