OSRTCtxtPtr Class Reference

Context reference counted pointer class. More...

#include <OSRTContext.h>

List of all members.

Public Member Functions

 OSRTCtxtPtr (OSRTContext *rf=0)
 This constructor set the internal context pointer to the given value and, if it is non-zero, increases the reference count by one.
 OSRTCtxtPtr (const OSRTCtxtPtr &o)
 The copy constructor copies the pointer from the source pointer object and, if it is non-zero, increases the reference count by one.
virtual ~OSRTCtxtPtr ()
 The destructor decrements the reference counter to the internal context pointer object.
OSRTCtxtPtroperator= (const OSRTCtxtPtr &rf)
 This assignment operator assigns this OSRTCtxtPtr to another.
OSRTCtxtPtroperator= (OSRTContext *rf)
 This assignment operator assigns does a direct assignment of an OSRTContext object to this OSRTCtxtPtr object.
 operator OSRTContext * ()
 The 'OSRTContext*' operator returns the context object pointer.
OSRTContextoperator-> ()
 The '->' operator returns the context object pointer.
OSBOOL operator== (const OSRTContext *o) const
 The '==' operator compares two OSRTContext pointer values.
OSBOOL isNull () const
 The isNull method returns TRUE if the underlying context pointer is NULL.
OSCTXT * getCtxtPtr ()
 This method returns the standard context pointer used in C function calls.

Protected Attributes

OSRTContextmPointer
 The mPointer member variable is a pointer to a reference-counted ASN.1 context wrapper class object.

Detailed Description

Context reference counted pointer class.

This class allows a context object to automatically be released when its reference count goes to zero. It is very similar to the standard C++ library auto_ptr smart pointer class but only works with an OSRTContext object.

Definition at line 313 of file OSRTContext.h.


Constructor & Destructor Documentation

OSRTCtxtPtr::OSRTCtxtPtr ( OSRTContext rf = 0  )  [inline]

This constructor set the internal context pointer to the given value and, if it is non-zero, increases the reference count by one.

Parameters:
rf - Pointer to OSRTContext object

Definition at line 328 of file OSRTContext.h.

OSRTCtxtPtr::OSRTCtxtPtr ( const OSRTCtxtPtr o  )  [inline]

The copy constructor copies the pointer from the source pointer object and, if it is non-zero, increases the reference count by one.

Parameters:
o - Reference to OSRTCtxtPtr object to be copied

Definition at line 338 of file OSRTContext.h.

virtual OSRTCtxtPtr::~OSRTCtxtPtr (  )  [inline, virtual]

The destructor decrements the reference counter to the internal context pointer object.

The context object will delete itself if its reference count goes to zero.

Definition at line 347 of file OSRTContext.h.


Member Function Documentation

OSRTCtxtPtr& OSRTCtxtPtr::operator= ( const OSRTCtxtPtr rf  )  [inline]

This assignment operator assigns this OSRTCtxtPtr to another.

The reference count of the context object managed by this object is first decremented. Then the new pointer is assigned and that object's reference count is incremented.

Parameters:
rf - Pointer to OSRTCtxtPtr smart-pointer object

Definition at line 357 of file OSRTContext.h.

References OSRTContext::_ref(), and mPointer.


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