A Discrete-Event Network Simulator
API
Core

The "core" module contains: More...

+ Collaboration diagram for Core:

Modules

 Attributes
 The ns-3 attribute system is the mechanism used in ns-3 to organize, document, and modify the values used by the various component models.
 
 Build version reporting
 Version information is pulled from the local git repository during the build process.
 
 CSV File Reader
 A way to extract data from simple csv files.
 
 Callbacks
 Wrap functions, objects, and arguments into self contained callbacks.
 
 Command Line Parsing
 A uniform way to specify program documentation, allowed command line arguments and help strings, and set any attribute or global value, all from the command line directly.
 
 Configuration
 Configuration of simulation parameters and tracing.
 
 Core module examples
 Programs which illustrate use of core module functionality.
 
 Core module helper classes
 Helper classes for the Core module.
 
 Core module tests
 TestSuites for the Core module.
 
 Debugging tools
 Assertions, breakpoints, logging, and abnormal program termination.
 
 Fatal Error Handlers
 Functions to help clean up when a fatal error is encountered.
 
 Geometry primitives
 Primitives for geometry, such as vectors and angles.
 
 Hash Functions
 Generic Hash function interface.
 
 High Precision Q64.64
 Functions and class for high precision Q64.64 fixed point arithmetic.
 
 Length
 Management of lengths in real world units.
 
 Object
 Base classes which provide memory management and object aggregation.
 
 Random Variables
 ns-3 random numbers are provided via instances of ns3::RandomVariableStream.
 
 Scheduler and Events
 Manage the event list by creating and scheduling events.
 
 Simulator
 Control the virtual time and the execution of simulation events.
 
 Smart Pointer
 Heap memory management.
 
 System Services
 System-independent interfaces to operating system services: environment variables, files system, threading, wall clock time.
 
 Testing
 Tools to define and execute unit tests.
 
 Tracing
 Publish/subscribe tools to collect and report changes to any values used by the various model components.
 
 Virtual Time
 Management of virtual time in real world units.
 
 Virtual Time Timer and Watchdog
 The Timer and Watchdog objects both facilitate scheduling functions to execute a specified virtual time in the future.
 

Files

file  core.h
 This file provides some doxygen documentation for the core module.
 
file  csv-reader.cc
 ns3::CsvReader implementation
 
file  csv-reader.h
 ns3::CsvReader declaration
 
file  deprecated.h
 NS_DEPRECATED macro definition.
 
file  global-value-test-suite.cc
 GlobalValue test suite.
 
file  global-value.cc
 ns3::GlobalValue implementation.
 
file  global-value.h
 ns3::GlobalValue declaration.
 
file  math.h
 log2() macro definition; to deal with Bug 1467.
 
file  show-progress.cc
 ns3::ShowProgress implementation.
 
file  show-progress.h
 ns3::ShowProgress declaration.
 
file  simulation-singleton.h
 ns3::SimulationSingleton declaration and template implementation.
 

Classes

class  ns3::ShowProgress
 Periodically print a status message indicating simulator progress. More...
 
class  ns3::SimulationSingleton< T >
 This singleton class template ensures that the type for which we want a singleton has a lifetime bounded by the simulation run lifetime. More...
 

Macros

#define NS_DEPRECATED(msg)   [[deprecated(msg)]]
 Mark a function as deprecated. More...
 
#define NS_DEPRECATED_3_40(msg)   NS_DEPRECATED(msg)
 Tag for things deprecated in version ns-3.40. More...
 
#define NS_DEPRECATED_3_41(msg)   NS_DEPRECATED(msg)
 Tag for things deprecated in version ns-3.41. More...
 
#define NS_WARNING_POP
 Pops the diagnostic warning list from the stack, restoring it to the previous state. More...
 
#define NS_WARNING_PUSH
 Push the diagnostic warning list to the stack, allowing it to be restored later. More...
 
#define NS_WARNING_PUSH_DEPRECATED
 Save the current warning list and disables the ones about deprecated functions and classes. More...
 
#define NS_WARNING_SILENCE_DEPRECATED
 Silences the "-Wdeprecated-declarations" warnings. More...
 

Detailed Description

The "core" module contains:

Todo:
Move all Private and Impl classes to namespace ns3::impl?

Macro Definition Documentation

◆ NS_DEPRECATED

#define NS_DEPRECATED (   msg)    [[deprecated(msg)]]

Mark a function as deprecated.

Users should expect deprecated features to be removed eventually.

When deprecating a feature, please update the documentation with information for users on how to update their code.

For example,

/*
* Do something useful.
*
* \deprecated This method will go away in future versions of ns-3.
* See instead TheNewWay()
*/
NS_DEPRECATED_3_XX("see TheNewWay")
/*
* Do something more useful.
*/
void TheNewWay();
void TheNewWay()
void SomethingUseful()

Please follow these two guidelines to ease future maintenance (primarily the eventual removal of the deprecated code):

  1. Please use the versioned form NS_DEPRECATED_3_XX, not the generic NS_DEPRECATED.
  2. Typically only the declaration needs to be deprecated,
NS_DEPRECATED_3_XX ("see TheNewWay") void SomethingUseful ();

but it's helpful to put the same macro as a comment at the site of the definition, to make it easier to find all the bits which eventually have to be removed:

\/\* NS_DEPRECATED_3_XX ("see TheNewWay") *\\/
void SomethingUseful () { ... }

.

Note
Sometimes it is necessary to silence a deprecation warning. Even though this is highly discouraged, if necessary it is possible to use:
// call to a function or class that has been deprecated.
#define NS_WARNING_POP
Pops the diagnostic warning list from the stack, restoring it to the previous state.
Definition: warnings.h:78
#define NS_WARNING_PUSH_DEPRECATED
Save the current warning list and disables the ones about deprecated functions and classes.
Definition: warnings.h:82
These macros are defined in warnings.h
Parameters
msgOptional message to add to the compiler warning.

Definition at line 75 of file deprecated.h.

◆ NS_DEPRECATED_3_40

#define NS_DEPRECATED_3_40 (   msg)    NS_DEPRECATED(msg)

Tag for things deprecated in version ns-3.40.

Definition at line 89 of file deprecated.h.

◆ NS_DEPRECATED_3_41

#define NS_DEPRECATED_3_41 (   msg)    NS_DEPRECATED(msg)

Tag for things deprecated in version ns-3.41.

Definition at line 82 of file deprecated.h.

◆ NS_WARNING_POP

#define NS_WARNING_POP

Pops the diagnostic warning list from the stack, restoring it to the previous state.

See also
NS_WARNING_PUSH

Definition at line 78 of file warnings.h.

◆ NS_WARNING_PUSH

#define NS_WARNING_PUSH

Push the diagnostic warning list to the stack, allowing it to be restored later.

See also
NS_WARNING_POP

Definition at line 76 of file warnings.h.

◆ NS_WARNING_PUSH_DEPRECATED

#define NS_WARNING_PUSH_DEPRECATED
Value:
NS_WARNING_SILENCE_DEPRECATED
#define NS_WARNING_PUSH
Push the diagnostic warning list to the stack, allowing it to be restored later.
Definition: warnings.h:76

Save the current warning list and disables the ones about deprecated functions and classes.

This macro can be used to silence deprecation warnings and should be used as a last resort to silence the compiler for very specific lines of code. The typical pattern is:

// call to a function or class that has been deprecated.

Its use is, of course, not suggested unless strictly necessary.

Definition at line 82 of file warnings.h.

◆ NS_WARNING_SILENCE_DEPRECATED

#define NS_WARNING_SILENCE_DEPRECATED

Silences the "-Wdeprecated-declarations" warnings.

See also
NS_WARNING_POP

Definition at line 77 of file warnings.h.