yast2-core
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
BasicRepPtr Class Reference

Base class wraping a Rep* and managing reference counting. More...

#include <Rep.h>

Inheritance diagram for BasicRepPtr:
VarPtr< _Rep >

Public Member Functions

 operator const void * () const
 

Protected Member Functions

 BasicRepPtr ()
 
 BasicRepPtr (Rep *ptr)
 
 BasicRepPtr (const BasicRepPtr &rhs)
 
BasicRepPtroperator= (const BasicRepPtr &rhs)
 
 ~BasicRepPtr ()
 
ReprepPtr () const
 

Private Member Functions

void _assign (Rep *new_r)
 

Private Attributes

Rep_ptr
 

Friends

std::ostream & operator<< (std::ostream &str, const BasicRepPtr &obj)
 

Detailed Description

Base class wraping a Rep* and managing reference counting.

A BasicRepPtr is explicity constructed from a Rep*. It references Rep while it holds the pointer and adjusts the reference counter on copy and assignment.

It may serve as base for template classes operating on data classes derived from Rep. For example VarPtr.

Constructor & Destructor Documentation

BasicRepPtr::BasicRepPtr ( )
inlineprotected

Default ctor: NULL

BasicRepPtr::BasicRepPtr ( Rep ptr)
inlineexplicitprotected

References _assign().

BasicRepPtr::BasicRepPtr ( const BasicRepPtr rhs)
inlineprotected

References _assign(), and _ptr.

BasicRepPtr::~BasicRepPtr ( )
inlineprotected

References _assign().

Member Function Documentation

void BasicRepPtr::_assign ( Rep new_r)
inlineprivate

Takes care of reference counter when assigning _ptr a new value.

References _ptr, Rep::ref(), and Rep::unref().

Referenced by BasicRepPtr(), operator=(), and ~BasicRepPtr().

BasicRepPtr::operator const void * ( ) const
inline

Allow easy test for NULL.

References _ptr.

BasicRepPtr& BasicRepPtr::operator= ( const BasicRepPtr rhs)
inlineprotected

References _assign(), and _ptr.

Rep* BasicRepPtr::repPtr ( ) const
inlineprotected
Returns
The Rep*.

References _ptr.

Referenced by VarPtr< _Rep >::ptr().

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  str,
const BasicRepPtr obj 
)
friend

Print out the Rep object.

Member Data Documentation

Rep* BasicRepPtr::_ptr
private

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

Generated on a sunny day for yast2-core by doxygen 1.8.5