core: Add CommandLine to some examples

This commit is contained in:
Peter D. Barnes, Jr.
2018-05-22 14:56:27 -07:00
parent ccd36a6aa4
commit 1f8a38d95a
4 changed files with 16 additions and 0 deletions

View File

@@ -19,6 +19,7 @@
#include "ns3/callback.h"
#include "ns3/assert.h"
#include "ns3/command-line.h"
#include <iostream>
/**
@@ -68,6 +69,9 @@ public:
int main (int argc, char *argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
// return type: double
// first arg type: double
// second arg type: double

View File

@@ -19,6 +19,7 @@
#include "ns3/ptr.h"
#include "ns3/object.h"
#include "ns3/command-line.h"
#include <iostream>
/**
@@ -92,6 +93,9 @@ ClearPtr (void)
int main (int argc, char *argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
{
// Create a new object of type PtrExample, store it in global
// variable g_ptr

View File

@@ -23,6 +23,7 @@
#include "ns3/string.h"
#include "ns3/integer.h"
#include "ns3/gnuplot.h"
#include "ns3/command-line.h"
#include <map>
#include <cmath>
@@ -102,6 +103,9 @@ Histogram (Ptr<RandomVariableStream> rndvar,
int main (int argc, char *argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
unsigned int probes = 1000000;
double precision = 0.01;

View File

@@ -23,6 +23,7 @@
#include "ns3/string.h"
#include "ns3/integer.h"
#include "ns3/gnuplot.h"
#include "ns3/command-line.h"
#include <map>
#include <cmath>
@@ -102,6 +103,9 @@ Histogram (Ptr<RandomVariableStream> rndvar,
int main (int argc, char *argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
unsigned int probes = 1000000;
double precision = 0.01;