1 // This is brl/bseg/bapl/bapl_keypoint_sptr.h 2 #ifndef bapl_keypoint_sptr_h_ 3 #define bapl_keypoint_sptr_h_ 4 //: 5 // \file 6 // \brief Smart pointer to a keypoint 7 // \author Matthew Leotta, (mleotta@lems.brown.edu) 8 // \date Sat Nov 8 2003 9 // 10 11 class bapl_keypoint; 12 class bapl_keypoint_set; 13 14 #include <vbl/vbl_smart_ptr.h> 15 16 struct bapl_keypoint_sptr : public vbl_smart_ptr<bapl_keypoint> { 17 typedef vbl_smart_ptr<bapl_keypoint> base; 18 19 bapl_keypoint_sptr() = default; bapl_keypoint_sptrbapl_keypoint_sptr20 bapl_keypoint_sptr(bapl_keypoint* p): base(p) {} vertical_castbapl_keypoint_sptr21 void vertical_cast(bapl_keypoint_sptr const& that) { *this = that; } vertical_castbapl_keypoint_sptr22 void vertical_cast(bapl_keypoint* t) { *this = t; } 23 }; 24 25 // Stop doxygen documenting the B class 26 #ifndef DOXYGEN_SHOULD_SKIP_THIS 27 template <class T, class B = bapl_keypoint_sptr> 28 struct bapl_keypoint_sptr_t : public B { bapl_keypoint_sptr_tbapl_keypoint_sptr_t29 bapl_keypoint_sptr_t(): B() {} bapl_keypoint_sptr_tbapl_keypoint_sptr_t30 bapl_keypoint_sptr_t(T* p): B(p) {} bapl_keypoint_sptr_tbapl_keypoint_sptr_t31 bapl_keypoint_sptr_t(bapl_keypoint_sptr_t<T> const& r): B(r) {} 32 void operator=(bapl_keypoint_sptr_t<T> const& r) { B::operator=(r); } 33 T* operator->() const { return (T*)B::as_pointer(); } 34 }; 35 #endif // DOXYGEN_SHOULD_SKIP_THIS 36 37 #endif // bapl_keypoint_sptr_h_ 38