namespace Utility
{
namespace ReferenceCounting
{
template <typename T>
class SmartPtr
{
public:
typedef
T
Type;
class NotInitialized_ {};
typedef
ExH::Compound<NotInitialized_, ExH::Logic::DescriptiveException>
NotInitialized;
public:
SmartPtr () throw ();
SmartPtr (Type* ptr) throw ();
SmartPtr (SmartPtr<Type> const& s_ptr)
throw (Interface::Exception, Interface::SystemException);
template <typename Other>
SmartPtr (SmartPtr<Other> const& s_ptr)
throw (Interface::Exception, Interface::SystemException);
~SmartPtr () throw ();
SmartPtr<Type>&
operator= (Type* ptr) throw ();
SmartPtr<Type>&
operator= (SmartPtr<Type> const& s_ptr)
throw (Interface::Exception, Interface::SystemException);
template <typename Other>
SmartPtr<Type>&
operator= (SmartPtr<Other> const& s_ptr)
throw (Interface::Exception, Interface::SystemException);
operator Type* () const throw ();
Type*
operator-> () const throw (NotInitialized);
Type*
in () const throw ();
Type*
retn() throw ();
private:
Type* ptr_;
};
template <typename T>
T*
add_ref (SmartPtr<T> const& ptr)
throw (Interface::Exception, Interface::SystemException);
template <typename D, typename S>
D*
smart_cast (SmartPtr<S> const& s)
throw (Interface::Exception, Interface::SystemException);
template <typename T>
SmartPtr<T>
acquire (T* ptr) throw (Interface::Exception, Interface::SystemException);
}
}