PolyBoRi
WeakRingPtr.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00014 //*****************************************************************************
00015 
00016 #ifndef polybori_WeakRingPtr_h_
00017 #define polybori_WeakRingPtr_h_
00018 
00019 // include basic definitions
00020 #include <polybori/pbori_defs.h>
00021 #include <polybori/common/CWeakPtr.h>
00022 #include <polybori/BoolePolyRing.h>
00023 
00024 BEGIN_NAMESPACE_PBORI
00025 
00032 class WeakRingPtr {
00034   typedef WeakRingPtr self;
00035 
00036 public:
00037   typedef BoolePolyRing value_type;
00038 
00040   WeakRingPtr(const value_type& data): m_data(*data.core()) {}
00041 
00043   WeakRingPtr(const self& rhs): m_data(rhs.m_data) {}
00044 
00046   ~WeakRingPtr() {}
00047 
00049   value_type operator*() const { return value_type(m_data); }
00050 
00052   operator bool() const { return m_data; }
00053 
00054 private:
00055   CWeakPtr<value_type::core_type> m_data;
00056 };
00057 
00058 END_NAMESPACE_PBORI
00059 
00060 #endif /* polybori_WeakRingPtr_h_ */