rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions
IlSharedPtr< T > Class Template Reference

Manages the storage of a pointer, providing a limited garbage-collection facility, possibly sharing that management with other objects. More...

#include <ilog/shrptr.h>

Public Member Functions

 IlSharedPtr (T *ptr=0)
 Constructor. More...
 
 IlSharedPtr (const IlSharedPtr< T > &other)
 Copy constructor. More...
 
 ~IlSharedPtr ()
 Destructor. More...
 
T * get () const
 Access to the encapsulated pointer. More...
 
IlSharedPtr< T > & operator= (const IlSharedPtr< T > &other)
 Assignment operator. More...
 

Detailed Description

template<class T>
class IlSharedPtr< T >

Manages the storage of a pointer, providing a limited garbage-collection facility, possibly sharing that management with other objects.

Library: ilog

This template class is largely inspired from the share_ptr template class provided in the ISO C++ Standard Template Library. It is replicated here (and substantially simplified) because of portability limitations. Only crucial methods are implemented.

Constructor & Destructor Documentation

template<class T >
IlSharedPtr< T >::IlSharedPtr ( T *  ptr = 0)

Constructor.

Creates an initial reference on the pointer.

template<class T >
IlSharedPtr< T >::IlSharedPtr ( const IlSharedPtr< T > &  other)

Copy constructor.

Creates an additional reference on the encapsulated pointer.

template<class T >
IlSharedPtr< T >::~IlSharedPtr ( )

Destructor.

If no other smart pointer is sharing the encapsulated pointer, then it is deleted.

Member Function Documentation

template<class T >
T* IlSharedPtr< T >::get ( ) const

Access to the encapsulated pointer.

Returns
The encapsulated pointer.
template<class T >
IlSharedPtr<T>& IlSharedPtr< T >::operator= ( const IlSharedPtr< T > &  other)

Assignment operator.

Parameters
otherThe shared pointer to be copied.

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.