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