1 #ifndef INCLUDE_ORA_UNIQUEREF_H
2 #define INCLUDE_ORA_UNIQUEREF_H
51 operator bool ()
const;
57 boost::shared_ptr<T>&
share()
const;
63 const std::type_info*
typeInfo()
const;
84 boost::shared_ptr<IPtrLoader>&
loader()
const {
96 T*
ptr(
bool throw_flag)
const;
115 m_ptr(),m_loader(),m_isLoaded(
false) {}
118 m_ptr(anObject),m_loader(),m_isLoaded(
true) {}
121 m_ptr(aPtr.m_ptr),m_loader(aPtr.m_loader),m_isLoaded(
false){
126 m_ptr(aPtr.share()),m_loader(aPtr.loader()),m_isLoaded(aPtr.isLoaded()) {
128 C*
c = 0;
T*
t(c); assert(t==0);
151 C*
c = 0;
T*
t(c); assert(t==0);
154 m_ptr = aPtr.
share();
162 m_ptr = boost::dynamic_pointer_cast(aPtr.
share());
189 const std::type_info*
ret = 0;
190 if(m_ptr) ret = &
typeid(*m_ptr);
199 return ptr(
false)==0;
214 if(!m_isLoaded && m_loader.get()){
215 m_ptr.reset( static_cast<T*>(m_loader->load()));
boost::shared_ptr< IPtrLoader > & loader() const
const std::type_info * typeInfo() const
UniqueRef< T > & operator=(T *)
boost::shared_ptr< T > m_ptr
T * ptr(bool throw_flag) const
bool operator==(const UniqueRef< C > &aPtr) const
boost::shared_ptr< T > & share() const
UniqueRef< T > & cast(const UniqueRef< C > &)
boost::shared_ptr< IPtrLoader > m_loader
void throwException(const std::string &message, const std::string &methodName)
void reset(double vett[256])
bool operator!=(const UniqueRef< C > &aPtr) const