8 #ifndef ATLAS_OBJECTS_SMARTPTR_H 9 #define ATLAS_OBJECTS_SMARTPTR_H 11 #include <Atlas/Exception.h> 13 namespace Atlas {
namespace Objects {
28 typedef typename T::iterator iterator;
29 typedef typename T::const_iterator const_iterator;
40 template<
class oldType>
47 if (a.get() != this->
get()) {
54 template<
class newType>
58 template<
class newType>
62 bool isValid()
const {
65 T& operator*()
const {
71 T* operator->()
const {
88 return SmartPtr(ptr->getDefaultObject());
107 template<
typename returnPtrType,
class fromType>
110 return returnPtrType(dynamic_cast<typename returnPtrType::DataT*>(o.get()));
113 template<
typename returnPtrType,
class fromType>
116 return returnPtrType((
typename returnPtrType::DataT *)o.get());
121 #endif // ATLAS_OBJECTS_SMARTPTR_H The Atlas namespace.
Definition: Bridge.h:20
Definition: SmartPtr.h:15
Base class for all exceptions thrown by Atlas-C++.
Definition: Exception.h:17