This singleton class template ensures that the type for which we want a singleton has a lifetime bounded by the simulation run lifetime. More...
#include "simulation-singleton.h"
Static Public Member Functions | |
static T * | Get (void) |
Get a pointer to the singleton instance. More... | |
Private Member Functions | |
Singleton pattern | |
Private constructor, copy and assignment operator. Note these do not have to be implemented, since they are never called. | |
SimulationSingleton (void) | |
Default constructor. More... | |
SimulationSingleton (const SimulationSingleton< T > &) | |
Copy constructor. More... | |
SimulationSingleton< T > | operator= (const SimulationSingleton< T > &) |
Assignment. More... | |
Static Private Member Functions | |
static void | DeleteObject (void) |
Delete the static instance. More... | |
static T ** | GetObject (void) |
Get the singleton object, creating a new one if it doesn't exist yet. More... | |
This singleton class template ensures that the type for which we want a singleton has a lifetime bounded by the simulation run lifetime.
That it, the underlying type will be automatically deleted upon a call to Simulator::Destroy.
For a singleton with a lifetime bounded by the process, not the simulation run, see Singleton.
Definition at line 43 of file simulation-singleton.h.
|
private |
Default constructor.
|
private |
Copy constructor.
|
staticprivate |
Delete the static instance.
Definition at line 128 of file simulation-singleton.h.
|
static |
Get a pointer to the singleton instance.
This instance will be automatically deleted when the simulation is destroyed by a call to Simulator::Destroy.
Definition at line 107 of file simulation-singleton.h.
Referenced by ns3::Ipv4AddressGenerator::AddAllocated(), ns3::GlobalRouteManager::BuildGlobalRoutingDatabase(), ns3::GlobalRouteManager::DeleteGlobalRoutes(), ns3::Ipv4AddressGenerator::GetAddress(), ns3::Ipv4AddressGenerator::GetNetwork(), ns3::Ipv4AddressGenerator::Init(), ns3::Ipv4AddressGenerator::InitAddress(), ns3::GlobalRouteManager::InitializeRoutes(), ns3::Ipv4AddressGenerator::IsAddressAllocated(), ns3::Ipv4AddressGenerator::IsNetworkAllocated(), ns3::Ipv4AddressGenerator::NextAddress(), ns3::Ipv4AddressGenerator::NextNetwork(), ns3::Ipv4AddressGenerator::Reset(), and ns3::Ipv4AddressGenerator::TestMode().
|
staticprivate |
Get the singleton object, creating a new one if it doesn't exist yet.
Definition at line 115 of file simulation-singleton.h.
References ns3::Simulator::ScheduleDestroy().
|
private |
Assignment.