template<class T,ptr::SafeProperty property> class GradSoft::counted_ptr

shared counted pointer, (not thread-safe);

Inheritance:


Public Methods

[more] counted_ptr() throw()
initialize to NULL value
[more] counted_ptr(const counted_ptr& x) throw()
copy constructror
[more]explicit counted_ptr(T* pT) throw(std::bad_alloc)
explicit constructor with pointer;
     * Usage:     *   counted_ptr<My> my(new My());     *
[more] ~counted_ptr()
destructor
[more]counted_ptr operator=(const counted_ptr& x) throw()
[more]T* operator->() throw(NullPointerException)
return pointer to T*.
[more]const T* operator->() const throw(NullPointerException)
const version of operator->
[more]T& operator*()
reference operator
  • when safe: return internal pointer by reference or throw NullPointerException if internal pointer is NULL
  • when unsafe: return internal pointer by reference or do undefiend behaviour if internal pointer is NULL.
    [more]const T& operator*() const
    const version of *()
    [more]T* get() const throw()
    return internal pointer
    [more]void set(T* pT) throw(std::bad_alloc)
    set current wrapper to another pointer; analog of
         * x = new counted_ptr<T,safety>(pt);     *
    [more]void assign(T* newT) throw(std::bad_alloc)
    • assign another value to internal shared value;
    • all counted_ptr-s, which was pointed on old T, will pointed to newT;
    [more]int getRefCount(void) const throw()
    [more]bool operator==(const counted_ptr& x) const throw()
    [more]bool isNULL(void) const throw()
    [more]bool isNull(void) const throw()
    [more]bool operator!=(const counted_ptr& x) const
    [more]bool operator!=(const T* x) const


Documentation

shared counted pointer, (not thread-safe);
o counted_ptr() throw()
initialize to NULL value

o counted_ptr(const counted_ptr& x) throw()
copy constructror

oexplicit counted_ptr(T* pT) throw(std::bad_alloc)
explicit constructor with pointer;
    * Usage:
    *   counted_ptr<My> my(new My());
    *

o ~counted_ptr()
destructor

ocounted_ptr operator=(const counted_ptr& x) throw()

oT* operator->() throw(NullPointerException)
return pointer to T*.

oconst T* operator->() const throw(NullPointerException)
const version of operator->

oT& operator*()
reference operator

oconst T& operator*() const
const version of *()

oT* get() const throw()
return internal pointer

ovoid set(T* pT) throw(std::bad_alloc)
set current wrapper to another pointer; analog of
    * x = new counted_ptr<T,safety>(pt);
    *

ovoid assign(T* newT) throw(std::bad_alloc)

oint getRefCount(void) const throw()

obool operator==(const counted_ptr& x) const throw()

obool isNULL(void) const throw()

obool isNull(void) const throw()

obool operator!=(const counted_ptr& x) const

obool operator!=(const T* x) const


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.