Bug 1550 - should all GlobalValues be static?
should all GlobalValues be static?
Status: NEW
Product: ns-3
Classification: Unclassified
Component: core
pre-release
PC Linux
: P5 enhancement
Assigned To: Mathieu Lacage
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-12 00:01 EST by Tom Henderson
Modified: 2012-12-12 04:01 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.