FacetPtr< T > Class Template Reference

#include <Pt/Forms/Style.h>

Manages a reference-counted Style::Facet. More...

Public Member Functions

 FacetPtr (T *facet=0)
 Holds facet, or 0.
 
 FacetPtr (const FacetPtr &ptr)
 Shares the facet held by ptr.
 
 ~FacetPtr ()
 Destructor.
 
FacetPtroperator= (const FacetPtr &ptr)
 Replaces the held facet with the facet from ptr.
 
void reset (T *facet=0)
 Replaces the held facet with facet, or 0.
 
T * operator-> () const
 Returns the facet.
 
T & operator* () const
 Returns the facet.
 
bool operator! () const
 Returns true if no facet is held.
 
 operator bool () const
 Returns true if a facet is held.
 
T * get ()
 Returns the facet, or 0.
 
const T * get () const
 Returns the facet, or 0.
 

Detailed Description

template<typename T>
class Pt::Forms::FacetPtr< T >

Construction, copy, and reset() take a reference to an existing facet. Destruction releases it and destroys the facet when the count reaches 0. Pass a facet with a reference count of 0.