Heap memory management. More...
Files | |
file | default-deleter.h |
Default deletion implementation for reference-counted smart pointers. | |
file | ptr.h |
Smart pointer implementation. | |
file | simple-ref-count.h |
Reference counting for smart pointers. | |
Classes | |
struct | ns3::DefaultDeleter< T > |
A template used to delete objects by the ns3::SimpleRefCount templates when the last reference to an object they manage disappears. More... | |
struct | ns3::ObjectDeleter |
Standard Object deleter, used by SimpleRefCount to delete an Object when the reference count drops to zero. More... | |
class | ns3::Ptr< T > |
Smart pointer class similar to boost::intrusive_ptr . More... | |
class | ns3::SimpleRefCount< T, PARENT, DELETER > |
A template-based reference counting class. More... | |
class | ns3::Ptr< T >::Tester |
Helper to test for null pointer. More... | |
Functions | |
template<typename T > | |
Ptr< T > | ns3::Create (void) |
Create class instances by constructors with varying numbers of arguments and return them by Ptr. More... | |
template<typename T , typename T1 > | |
Ptr< T > | ns3::Create (T1 a1) |
template<typename T , typename T1 , typename T2 > | |
Ptr< T > | ns3::Create (T1 a1, T2 a2) |
template<typename T , typename T1 , typename T2 , typename T3 > | |
Ptr< T > | ns3::Create (T1 a1, T2 a2, T3 a3) |
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 > | |
Ptr< T > | ns3::Create (T1 a1, T2 a2, T3 a3, T4 a4) |
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > | |
Ptr< T > | ns3::Create (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) |
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 > | |
Ptr< T > | ns3::Create (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) |
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 > | |
Ptr< T > | ns3::Create (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7) |
template<typename T > | |
std::ostream & | ns3::operator<< (std::ostream &os, const Ptr< T > &p) |
Output streamer. More... | |
template<typename T1 , typename T2 > | |
bool | ns3::operator== (Ptr< T1 > const &lhs, T2 const *rhs) |
Equality operator. More... | |
template<typename T1 , typename T2 > | |
bool | ns3::operator== (T1 const *lhs, Ptr< T2 > &rhs) |
Equality operator. More... | |
template<typename T1 , typename T2 > | |
bool | ns3::operator== (Ptr< T1 > const &lhs, Ptr< T2 > const &rhs) |
Equality operator. More... | |
template<typename T1 , typename T2 > | |
bool | ns3::operator!= (Ptr< T1 > const &lhs, T2 const *rhs) |
Inequality operator. More... | |
template<typename T1 , typename T2 > | |
bool | ns3::operator!= (T1 const *lhs, Ptr< T2 > &rhs) |
Inequality operator. More... | |
template<typename T1 , typename T2 > | |
bool | ns3::operator!= (Ptr< T1 > const &lhs, Ptr< T2 > const &rhs) |
Inequality operator. More... | |
template<typename T > | |
bool | ns3::operator< (const Ptr< T > &lhs, const Ptr< T > &rhs) |
Comparison operator applied to the underlying pointers. More... | |
template<typename T > | |
bool | ns3::operator<= (const Ptr< T > &lhs, const Ptr< T > &rhs) |
Comparison operator applied to the underlying pointers. More... | |
template<typename T > | |
bool | ns3::operator> (const Ptr< T > &lhs, const Ptr< T > &rhs) |
Comparison operator applied to the underlying pointers. More... | |
template<typename T > | |
bool | ns3::operator>= (const Ptr< T > &lhs, const Ptr< T > &rhs) |
Comparison operator applied to the underlying pointers. More... | |
Heap memory management.
See ns3::Ptr for implementation details.
See main-ptr.cc for example usage.
Ptr< T > ns3::Create | ( | void | ) |
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
These methods work for any class T
.
T | The type of class object to create. |
T
. Definition at line 514 of file ptr.h.
Referenced by ns3::TypeId::AddConstructor(), ns3::internal::MakeDoubleChecker(), ns3::internal::MakeIntegerChecker(), ns3::MakeSimpleAttributeChecker(), ns3::MakeTimeChecker(), and ns3::internal::MakeUintegerChecker().
Ptr< T > ns3::Create | ( | T1 | a1 | ) |
Ptr< T > ns3::Create | ( | T1 | a1, |
T2 | a2 | ||
) |
T | The type of class object to create. |
T1 | The type of the first constructor argument. |
T2 | The type of the second constructor argument. |
a1 | The first constructor argument. |
a2 | The second constructor argument. |
T
. Ptr< T > ns3::Create | ( | T1 | a1, |
T2 | a2, | ||
T3 | a3 | ||
) |
T | The type of class object to create. |
T1 | The type of the first constructor argument. |
T2 | The type of the second constructor argument. |
T3 | The type of the third constructor argument. |
a1 | The first constructor argument. |
a2 | The second constructor argument. |
a3 | The third constructor argument. |
T
. Ptr< T > ns3::Create | ( | T1 | a1, |
T2 | a2, | ||
T3 | a3, | ||
T4 | a4 | ||
) |
T | The type of class object to create. |
T1 | The type of the first constructor argument. |
T2 | The type of the second constructor argument. |
T3 | The type of the third constructor argument. |
T4 | The type of the fourth constructor argument. |
a1 | The first constructor argument. |
a2 | The second constructor argument. |
a3 | The third constructor argument. |
a4 | The fourth constructor argument. |
T
. Ptr< T > ns3::Create | ( | T1 | a1, |
T2 | a2, | ||
T3 | a3, | ||
T4 | a4, | ||
T5 | a5 | ||
) |
T | The type of class object to create. |
T1 | The type of the first constructor argument. |
T2 | The type of the second constructor argument. |
T3 | The type of the third constructor argument. |
T4 | The type of the fourth constructor argument. |
T5 | The type of the fifth constructor argument. |
a1 | The first constructor argument. |
a2 | The second constructor argument. |
a3 | The third constructor argument. |
a4 | The fourth constructor argument. |
a5 | The fifth constructor argument. |
T
. Ptr< T > ns3::Create | ( | T1 | a1, |
T2 | a2, | ||
T3 | a3, | ||
T4 | a4, | ||
T5 | a5, | ||
T6 | a6 | ||
) |
T | The type of class object to create. |
T1 | The type of the first constructor argument. |
T2 | The type of the second constructor argument. |
T3 | The type of the third constructor argument. |
T4 | The type of the fourth constructor argument. |
T5 | The type of the fifth constructor argument. |
T6 | The type of the sixth constructor argument. |
a1 | The first constructor argument. |
a2 | The second constructor argument. |
a3 | The third constructor argument. |
a4 | The fourth constructor argument. |
a5 | The fifth constructor argument. |
a6 | The sixth constructor argument. |
T
. Ptr< T > ns3::Create | ( | T1 | a1, |
T2 | a2, | ||
T3 | a3, | ||
T4 | a4, | ||
T5 | a5, | ||
T6 | a6, | ||
T7 | a7 | ||
) |
T | The type of class object to create. |
T1 | The type of the first constructor argument. |
T2 | The type of the second constructor argument. |
T3 | The type of the third constructor argument. |
T4 | The type of the fourth constructor argument. |
T5 | The type of the fifth constructor argument. |
T6 | The type of the sixth constructor argument. |
T7 | The type of the seventh constructor argument. |
a1 | The first constructor argument. |
a2 | The second constructor argument. |
a3 | The third constructor argument. |
a4 | The fourth constructor argument. |
a5 | The fifth constructor argument. |
a6 | The sixth constructor argument. |
a7 | The seventh constructor argument. |
T
. bool ns3::operator!= | ( | Ptr< T1 > const & | lhs, |
T2 const * | rhs | ||
) |
Inequality operator.
This enables code such as
Note that either p
or q
could also be ordinary pointers to the underlying object.
T1 | Type of the object on the lhs. |
T2 | Type of the object on the rhs. |
[in] | lhs | The left operand. |
[in] | rhs | The right operand. |
Definition at line 597 of file ptr.h.
References ns3::PeekPointer().
bool ns3::operator!= | ( | T1 const * | lhs, |
Ptr< T2 > & | rhs | ||
) |
Inequality operator.
This enables code such as
Note that either p
or q
could also be ordinary pointers to the underlying object.
T1 | Type of the object on the lhs. |
T2 | Type of the object on the rhs. |
[in] | lhs | The left operand. |
[in] | rhs | The right operand. |
Definition at line 604 of file ptr.h.
References ns3::PeekPointer().
bool ns3::operator!= | ( | Ptr< T1 > const & | lhs, |
Ptr< T2 > const & | rhs | ||
) |
Inequality operator.
This enables code such as
Note that either p
or q
could also be ordinary pointers to the underlying object.
T1 | Type of the object on the lhs. |
T2 | Type of the object on the rhs. |
[in] | lhs | The left operand. |
[in] | rhs | The right operand. |
Definition at line 618 of file ptr.h.
References ns3::PeekPointer().
std::ostream & ns3::operator<< | ( | std::ostream & | os, |
const Ptr< T > & | p | ||
) |
Output streamer.
[in] | os | The output stream. |
[in] | p | The Ptr. |
Definition at line 575 of file ptr.h.
References ns3::PeekPointer().
bool ns3::operator== | ( | Ptr< T1 > const & | lhs, |
T2 const * | rhs | ||
) |
Equality operator.
This enables code such as
Note that either p
or q
could also be ordinary pointers to the underlying object.
T1 | Type of the object on the lhs. |
T2 | Type of the object on the rhs. |
[in] | lhs | The left operand. |
[in] | rhs | The right operand. |
Definition at line 583 of file ptr.h.
References ns3::PeekPointer().
bool ns3::operator== | ( | T1 const * | lhs, |
Ptr< T2 > & | rhs | ||
) |
Equality operator.
This enables code such as
Note that either p
or q
could also be ordinary pointers to the underlying object.
T1 | Type of the object on the lhs. |
T2 | Type of the object on the rhs. |
[in] | lhs | The left operand. |
[in] | rhs | The right operand. |
Definition at line 590 of file ptr.h.
References ns3::PeekPointer().
bool ns3::operator== | ( | Ptr< T1 > const & | lhs, |
Ptr< T2 > const & | rhs | ||
) |
Equality operator.
This enables code such as
Note that either p
or q
could also be ordinary pointers to the underlying object.
T1 | Type of the object on the lhs. |
T2 | Type of the object on the rhs. |
[in] | lhs | The left operand. |
[in] | rhs | The right operand. |
Definition at line 611 of file ptr.h.
References ns3::PeekPointer().