Example program illustrating use of the ns3::Ptr smart pointer. More...
#include "ns3/ptr.h"
#include "ns3/object.h"
#include "ns3/command-line.h"
#include <iostream>
Go to the source code of this file.
Classes | |
class | PtrExample |
Example class illustrating use of Ptr. More... | |
Functions | |
static void | ClearPtr (void) |
Set g_ptr to NULL. More... | |
static Ptr< PtrExample > | StorePtr (Ptr< PtrExample > p) |
Example Ptr manipulations. More... | |
Variables | |
static Ptr< PtrExample > | g_ptr = 0 |
Example Ptr global variable. More... | |
Example program illustrating use of the ns3::Ptr smart pointer.
$ ./ns3 run "main-ptr"
Definition in file main-ptr.cc.
|
static |
|
static |
Example Ptr manipulations.
This function stores it's argument in the global variable g_ptr
and returns the old value of g_ptr
.
[in] | p | A Ptr. |
g_ptr
. Definition at line 76 of file main-ptr.cc.
References g_ptr.
|
static |
Example Ptr global variable.
Definition at line 65 of file main-ptr.cc.
Referenced by ClearPtr(), and StorePtr().