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>
114 returnPtrType smart_static_cast(
const SmartPtr<fromType> & o)
116 return returnPtrType((
typename returnPtrType::DataT *)o.get());
121 #endif // ATLAS_OBJECTS_SMARTPTR_H