Binc::SimpleRefCount< T, PARENT, DELETER > Class Template Reference
[Smart Pointer]

A template-based reference counting class. More...

#include <simple-ref-count.h>

List of all members.

Public Member Functions

void Ref (void) const
void Unref (void) const
uint32_t GetReferenceCount (void) const

Detailed Description

template<typename T, typename PARENT = empty, typename DELETER = DefaultDeleter<T>>
class Binc::SimpleRefCount< T, PARENT, DELETER >

This template can be used to give reference-counting powers to a class. This template does not require this class to have a virtual destructor or no parent class.

Note: if you are moving to this template from the RefCountBase class, you need to be careful to mark appropriately your destructor virtual if needed. i.e., if your class has subclasses, _do_ mark your destructor virtual.

This template takes 3 arguments but only the first argument is mandatory:

Interesting users of this class include ns3::Object as well as ns3::Packet.


Member Function Documentation

template<typename T, typename PARENT = empty, typename DELETER = DefaultDeleter<T>>
uint32_t Binc::SimpleRefCount< T, PARENT, DELETER >::GetReferenceCount ( void   )  const [inline]

Get the reference count of the object. Normally not needed; for language bindings.

template<typename T, typename PARENT = empty, typename DELETER = DefaultDeleter<T>>
void Binc::SimpleRefCount< T, PARENT, DELETER >::Ref ( void   )  const [inline]

Increment the reference count. This method should not be called by user code. SimpleRefCount instances are expected to be used in conjunction with the Ptr template which would make calling Ref unnecessary and dangerous.

template<typename T, typename PARENT = empty, typename DELETER = DefaultDeleter<T>>
void Binc::SimpleRefCount< T, PARENT, DELETER >::Unref ( void   )  const [inline]

Decrement the reference count. This method should not be called by user code. SimpleRefCount instances are expected to be used in conjunction with the Ptr template which would make calling Ref unnecessary and dangerous.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Friends
Generated on Sat Apr 30 23:15:47 2011 for libBiNC by  doxygen 1.6.3