A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ptr.h File Reference

ns3::Ptr smart pointer declaration and implementation. More...

#include "assert.h"
#include <iostream>
#include <stdint.h>
+ Include dependency graph for ptr.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ns3::CallbackTraits< Ptr< T > >
 Trait class to convert a pointer into a reference, used by MemPtrCallBackImpl. More...
 
struct  ns3::internal::EventMemberImplObjTraits< Ptr< T > >
 Helper for the MakeEvent functions which take a class method. More...
 
struct  std::hash< ns3::Ptr< T > >
 Hashing functor taking a Ptr and returning a std::size_t. More...
 
class  ns3::Ptr< T >
 Smart pointer class similar to boost::intrusive_ptr. More...
 

Namespaces

namespace  ns3
 Every class exported by the ns3 library is enclosed in the ns3 namespace.
 
namespace  ns3::internal
 Namespace for implementation details.
 

Functions

template<typename T1 , typename T2 >
Ptr< T1 > ns3::const_pointer_cast (const Ptr< T2 > &p)
 Return a copy of p with its stored pointer const casted from T2 to T1.
 
template<typename T , typename... Ts>
Ptr< T > ns3::Create (Ts &&... args)
 Create class instances by constructors with varying numbers of arguments and return them by Ptr.
 
template<typename U >
U * ns3::GetPointer (const Ptr< U > &p)
 
template<typename T1 , typename T2 >
std::enable_if_t< std::is_same_v< T2, std::nullptr_t >, bool > ns3::operator!= (const Ptr< T1 > &lhs, T2 rhs)
 Specialization for comparison to nullptr.
 
template<typename T >
std::ostream & ns3::operator<< (std::ostream &os, const Ptr< T > &p)
 Output streamer.
 
template<typename T1 , typename T2 >
std::enable_if_t< std::is_same_v< T2, std::nullptr_t >, bool > ns3::operator== (const Ptr< T1 > &lhs, T2 rhs)
 Specialization for comparison to nullptr.
 
template<typename U >
U * ns3::PeekPointer (const Ptr< U > &p)
 
template<typename T1 , typename T2 >
bool ns3::operator== (const Ptr< T1 > &lhs, const Ptr< T2 > &rhs)
 Equality operator.
 
template<typename T1 , typename T2 >
bool ns3::operator== (const Ptr< T1 > &lhs, T2 const *rhs)
 Equality operator.
 
template<typename T1 , typename T2 >
bool ns3::operator== (T1 const *lhs, Ptr< T2 > &rhs)
 Equality operator.
 
template<typename T1 , typename T2 >
bool ns3::operator!= (const Ptr< T1 > &lhs, const Ptr< T2 > &rhs)
 Inequality operator.
 
template<typename T1 , typename T2 >
bool ns3::operator!= (const Ptr< T1 > &lhs, T2 const *rhs)
 Inequality operator.
 
template<typename T1 , typename T2 >
bool ns3::operator!= (T1 const *lhs, Ptr< T2 > &rhs)
 Inequality operator.
 
template<typename T >
bool ns3::operator< (const Ptr< const T > &lhs, const Ptr< T > &rhs)
 Comparison operator applied to the underlying pointers.
 
template<typename T >
bool ns3::operator< (const Ptr< T > &lhs, const Ptr< const T > &rhs)
 Comparison operator applied to the underlying pointers.
 
template<typename T >
bool ns3::operator< (const Ptr< T > &lhs, const Ptr< T > &rhs)
 Comparison operator applied to the underlying pointers.
 
template<typename T >
bool ns3::operator<= (const Ptr< T > &lhs, const Ptr< T > &rhs)
 Comparison operator applied to the underlying pointers.
 
template<typename T >
bool ns3::operator> (const Ptr< T > &lhs, const Ptr< T > &rhs)
 Comparison operator applied to the underlying pointers.
 
template<typename T >
bool ns3::operator>= (const Ptr< T > &lhs, const Ptr< T > &rhs)
 Comparison operator applied to the underlying pointers.
 
template<typename T1 , typename T2 >
Ptr< T1 > ns3::ConstCast (const Ptr< T2 > &p)
 Cast a Ptr.
 
template<typename T1 , typename T2 >
Ptr< T1 > ns3::DynamicCast (const Ptr< T2 > &p)
 Cast a Ptr.
 
template<typename T1 , typename T2 >
Ptr< T1 > ns3::StaticCast (const Ptr< T2 > &p)
 Cast a Ptr.
 
template<typename T >
Ptr< T > ns3::Copy (Ptr< T > object)
 Return a deep copy of a Ptr.
 

Detailed Description

ns3::Ptr smart pointer declaration and implementation.

Definition in file ptr.h.