8 #ifndef HEPMC_DATA_SMARTPOINTER_H 9 #define HEPMC_DATA_SMARTPOINTER_H 11 #include "HepMC/Common.h" 13 #if defined(HEPMC_HAS_CXX11) || defined(HEPMC_HAS_CXX0X_GCC_ONLY) 18 using std::shared_ptr;
19 using std::make_shared;
20 using std::dynamic_pointer_cast;
21 using std::const_pointer_cast;
25 #error At least partial C++ 2011 support is required! 93 const shared_ptr<const T>
operator->()
const {
return const_pointer_cast<
const T>(
m_data); }
100 #ifdef HEPMC_HAS_CXX11 103 operator bool()
const {
return (
bool)
m_data; }
111 #ifndef HEPMC_NO_DEPRECATED 115 HEPMC_DEPRECATED(
"Use smart pointers instead of raw pointers")
119 operator bool() {
return (
bool)
m_data.get(); }
153 #include "HepMC/Data/SmartPointer.icc" const shared_ptr< const T > operator->() const
const T & operator*() const
Const dereferencing to a const reference of the contained type.
shared_ptr< T > m_data
Shared pointer.
SmartPointer & operator=(const SmartPointer &rhs)
Assignment.
bool operator==(const SmartPointer &rhs) const
Equality test.
SmartPointer< class GenParticle > GenParticlePtr
Smart pointer to GenParticle.
SmartPointer< const class GenParticle > ConstGenParticlePtr
Const smart pointer to GenParticle.
shared_ptr< class GenPdfInfo > GenPdfInfoPtr
Shared pointer to GenPdfInfo.
SmartPointer< const class GenVertex > ConstGenVertexPtr
Const smart pointer to GenVertex.
bool operator!=(const SmartPointer &rhs) const
Inequality test.
Smart pointer for HepMC objects.
shared_ptr< class GenCrossSection > GenCrossSectionPtr
Shared pointer to GenCrossSection.
T & operator*()
Non-const dereferencing to a reference of the contained type.
shared_ptr< class GenHeavyIon > GenHeavyIonPtr
Shared pointer to GenHeavyIon.
Definition of template class SmartPointer.
const shared_ptr< T > operator->()
Non-const access to the contained shared_ptr, with non-const contained type.
SmartPointer< class GenVertex > GenVertexPtr
Smart pointer to GenVertex.
bool operator<(const SmartPointer &rhs) const
Less-than comparison.
SmartPointer()
Default constructor (NULL pointer)