A template-based reference counting class. More...
#include <simple-ref-count.h>
Public Member Functions | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Static Public Member Functions | |
static void | Cleanup (void) |
Noop. More... | |
Private Attributes | |
uint32_t | m_count |
A template-based reference counting class.
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.
Definition at line 64 of file simple-ref-count.h.
|
inline |
Constructor.
Definition at line 70 of file simple-ref-count.h.
|
inline |
Copy constructor.
Definition at line 76 of file simple-ref-count.h.
|
inlinestatic |
Noop.
Definition at line 124 of file simple-ref-count.h.
|
inline |
Get the reference count of the object.
Normally not needed; for language bindings.
Definition at line 116 of file simple-ref-count.h.
Referenced by ns3::Object::CheckLoose(), and ns3::Object::DoDelete().
|
inline |
Assignment.
Definition at line 82 of file simple-ref-count.h.
|
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.
Definition at line 92 of file simple-ref-count.h.
|
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.
Definition at line 103 of file simple-ref-count.h.
Referenced by ns3::DefaultSimulatorImpl::DoDispose(), ns3::RealtimeSimulatorImpl::DoDispose(), ns3::NullMessageSimulatorImpl::DoDispose(), ns3::DistributedSimulatorImpl::DoDispose(), main(), ns3::DefaultSimulatorImpl::ProcessOneEvent(), ns3::NullMessageSimulatorImpl::ProcessOneEvent(), and ns3::DistributedSimulatorImpl::ProcessOneEvent().
|
mutableprivate |
Definition at line 128 of file simple-ref-count.h.
Referenced by ns3::SimpleRefCount< SpectrumSignalParameters >::GetReferenceCount(), ns3::SimpleRefCount< SpectrumSignalParameters >::Ref(), and ns3::SimpleRefCount< SpectrumSignalParameters >::Unref().