comet::identity_ptr Class Reference
[Com type wrappers.]

Represents the identity Unknown of an object. More...

#include <ptr.h>

List of all members.

Public Member Functions

 identity_ptr () throw ()
 Default constructor.
 ~identity_ptr () throw ()
 Destructor.
 identity_ptr (const identity_ptr &rhs)
 Copy constructor.
template<typename Itf>  identity_ptr (const impl::try_cast_t< Itf > &x) throw (com_error)
 Constructor from Try Cast.
 identity_ptr (const impl::try_cast_t< variant_t > &v) throw (com_error)
 Constructor from variant_t Try Cast.
template<typename Itf>  identity_ptr (const impl::com_cast_t< Itf > &x) throw (com_error)
 Constructor from Com Cast.
 identity_ptr (const impl::com_cast_t< variant_t > &v) throw (com_error)
 Constructor from variant_t com_cast.
 identity_ptr (int null) throw (com_error)
 Constructions of null pointer.
identity_ptroperator= (const identity_ptr &rhs) throw ()
 Copy assignment.
template<typename T> identity_ptroperator= (const T &rhs) throw (com_error)
 Other assignment.
identity_ptroperator= (int null) throw (com_error)
 Null assignment.
IUnknown * get () const throw ()
 Get at the raw pointer.
IUnknown * in () const throw ()
 Pass to an [in] parameter.
IUnknown * raw () const throw ()
 Get at raw interface.
bool is_null () const throw ()
 Returns true if the wrapped pointer is null.
bool operator== (int null) const
 Null comparison.
bool operator!= (int null) const
 Null comparison.
Pointer Comparison
!

bool operator< (const identity_ptr &x) const throw ()
bool operator> (const identity_ptr &x) const throw ()
bool operator<= (const identity_ptr &x) const throw ()
bool operator>= (const identity_ptr &x) const throw ()
bool operator== (const identity_ptr &x) const throw ()
bool operator!= (const identity_ptr &x) const throw ()

Protected Member Functions

void swap (identity_ptr &x) throw ()
void addref () const throw ()
void release () throw ()

Protected Attributes

IUnknown * ptr_

Related Functions

(Note that these are not member functions.)

bool operator== (int null, const identity_ptr &x) throw(com_error)
 Comparison with null.


Detailed Description

Represents the identity Unknown of an object.

Is the only really efficient and safe way of representing an object for comparisons.


Constructor & Destructor Documentation

comet::identity_ptr::identity_ptr  )  throw () [inline]
 

Default constructor.

Initialises the pointer to Null.

comet::identity_ptr::~identity_ptr  )  throw () [inline]
 

Destructor.

Releases the pointer.

comet::identity_ptr::identity_ptr const identity_ptr rhs  )  [inline]
 

Copy constructor.

Simple pointer copy. They are both already identity unknowns.

template<typename Itf>
comet::identity_ptr::identity_ptr const impl::try_cast_t< Itf > &  x  )  throw (com_error) [inline, explicit]
 

Constructor from Try Cast.

Used for construction from any Interface pointer. Always QIs to guarantee this is the identity.

comet::identity_ptr::identity_ptr const impl::try_cast_t< variant_t > &  v  )  throw (com_error) [inline, explicit]
 

Constructor from variant_t Try Cast.

Used for construction from a variant. Always QIs to guarantee this is the identity.

template<typename Itf>
comet::identity_ptr::identity_ptr const impl::com_cast_t< Itf > &  x  )  throw (com_error) [inline, explicit]
 

Constructor from Com Cast.

Used for construction from any Interface pointer. Always QIs to guarantee this is the identity.

comet::identity_ptr::identity_ptr const impl::com_cast_t< variant_t > &  v  )  throw (com_error) [inline, explicit]
 

Constructor from variant_t com_cast.

Used for construction from a variant. Always QIs to guarantee this is the identity.

comet::identity_ptr::identity_ptr int  null  )  throw (com_error) [inline, explicit]
 

Constructions of null pointer.

Parameters:
null Only 0 is valid. Any other value will cause E_POINTER to be thrown.
Exceptions:
com_error Throws E_POINTER if a non-zero value is specified.


Member Function Documentation

bool comet::identity_ptr::operator!= int  null  )  const [inline]
 

Null comparison.

Only comparison with a value of zero is allowed. Non-zero values will result in E_POINTER (wrapped in com_error) being thrown.

Exceptions:
com_error 

identity_ptr& comet::identity_ptr::operator= int  null  )  throw (com_error) [inline]
 

Null assignment.

Only null is allowed as argument. Attempting to assign a non-zero value will result in E_POINTER (wrapped in com_error) being thrown.

Exceptions:
com_error Throw E_POINTER if a non-zero value is specified.

template<typename T>
identity_ptr& comet::identity_ptr::operator= const T &  rhs  )  throw (com_error) [inline]
 

Other assignment.

Always QIs. Handles other assignments that have available constructors.

identity_ptr& comet::identity_ptr::operator= const identity_ptr rhs  )  throw () [inline]
 

Copy assignment.

Don't QI as this is definitely identity already.

bool comet::identity_ptr::operator== int  null  )  const [inline]
 

Null comparison.

Only comparison with a value of zero is allowed. Non-zero values will result in E_POINTER (wrapped in com_error) being thrown.

Exceptions:
com_error 


The documentation for this class was generated from the following file: