|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef GEOMODELUTILITIES_TRANSIENTCONSTSHAREDPTR_H
6 #define GEOMODELUTILITIES_TRANSIENTCONSTSHAREDPTR_H
27 template <
typename ObjGrp>
30 template <
typename ObjGrp>
38 template <
typename ObjGrp>
42 template <
typename ObjGrp>
47 template <
typename ObjGrp>
54 template <
typename ObjGrp>
60 template <
typename ObjGrp>
65 template <
typename ObjGrp>
70 template <
typename ObjGrp>
76 template <
typename ObjGrp>
77 void reset(std::unique_ptr<ObjGrp> newObj) {
m_ptr = std::move(newObj); }
82 operator bool()
const {
return m_ptr.get() !=
nullptr; }
The TransientConstSharedPtr allows non-const access if the pointer itself is non-const but in the con...
std::shared_ptr< Obj > m_ptr
size_t use_count() const
How many clients does the pointer have.
const Obj * operator->() const
TransientConstSharedPtr()=default
Standard constructor.
std::shared_ptr< const Obj > release()
Release the memory.
bool operator<(const TransientConstSharedPtr &other) const
Smaller operator to insert the pointer into sets.
TransientConstSharedPtr & operator=(TransientConstSharedPtr< ObjGrp > &&other)
Move assignment operator.
TransientConstSharedPtr(Obj *ptr)
Constructor from raw ptr.
TransientConstSharedPtr(TransientConstSharedPtr< ObjGrp > &&other)
Standard move constructor.
TransientConstSharedPtr & operator=(std::shared_ptr< ObjGrp > &&other)
TransientConstSharedPtr(const TransientConstSharedPtr< ObjGrp > &other)
Delete the copy constructor if the object is const.
TransientConstSharedPtr & operator=(const TransientConstSharedPtr< ObjGrp > &other)
Assignment operator.
TransientConstSharedPtr(std::shared_ptr< ObjGrp > ptr)
Constructor from shared_ptr.
Obj * get()
Get (non-const) access to the underlying object.
const Obj * get() const
Get const access to the underlying object.
void reset(std::unique_ptr< ObjGrp > newObj)
Overload the pointer.
const Obj & operator*() const
Dereference operator.
TransientConstSharedPtr & operator=(const std::shared_ptr< ObjGrp > &other)
TransientConstSharedPtr(std::unique_ptr< ObjGrp > ptr)
Constructor from unique_ptr.
setBGCode setTAP setLVL2ErrorBits bool
TransientConstSharedPtr & operator=(std::unique_ptr< ObjGrp > &&other)