namespace Utility
{
  namespace ReferenceCounting
  {
    class Interface
    {
    public:
      typedef
      unsigned long
      count_t;
      typedef
      ExH::System::Exception
      SystemException;
      class Exception_ {};
      typedef
      ExH::Compound<Exception_, ExH::Logic::DescriptiveException>
      Exception;
    public:
      virtual void
      add_ref () const throw (Exception, SystemException) = 0;
      virtual void
      remove_ref () const throw () = 0;
      virtual count_t
      refcount_value () const throw (Exception, SystemException) = 0;
    protected:
      Interface () throw ();
      virtual
      ~Interface () throw ();
    protected:
      virtual void
      add_ref_i () const throw (Exception, SystemException) = 0;
      virtual bool
      remove_ref_i () const throw (Exception, SystemException) = 0;
      virtual count_t
      refcount_value_i () const throw (Exception, SystemException) = 0;
    private:
      Interface (Interface const&) throw ();
      Interface&
      operator= (Interface const&) throw ();
    };
    template <typename Type>
    Type*
    add_ref (Type* ptr)
      throw (Interface::Exception, Interface::SystemException);
  }
}