Bug 1550

Summary: should all GlobalValues be static?
Product: ns-3 Reporter: Tom Henderson <tomh>
Component: coreAssignee: Mathieu Lacage <mathieu.lacage>
Status: NEW ---    
Severity: enhancement CC: ns-bugs
Priority: P5    
Version: pre-release   
Hardware: PC   
OS: Linux   

Description Tom Henderson 2012-12-12 00:01:23 EST
Am wondering whether we should make these simulator.cc global values into static:

GlobalValue g_simTypeImpl = GlobalValue ("SimulatorImplementationType",
                                         "The object class to use as the simulator implementation",
                                         StringValue ("ns3::DefaultSimulatorImpl"),
                                         MakeStringChecker ());

GlobalValue g_schedTypeImpl = GlobalValue ("SchedulerType",
                                           "The object class to use as the scheduler implementation",
                                           TypeIdValue (MapScheduler::GetTypeId ()),
                                           MakeTypeIdChecker ());


or else change the global-value.h documentation:

 * Instances of this class are expected to be allocated as static
 * global variables and should be used to store configurable global state.
Comment 1 Mathieu Lacage 2012-12-12 04:01:50 EST
(In reply to comment #0)
> Am wondering whether we should make these simulator.cc global values into
> static:

I do not mind but, does it matter ?

>  * Instances of this class are expected to be allocated as static
>  * global variables and should be used to store configurable global state.

Sure.