20 #ifndef COMMAND_LINE_H 
   21 #define COMMAND_LINE_H 
  227   void Usage (
const std::string usage);
 
  238   template <
typename T>
 
  239   void AddValue (
const std::string &name,
 
  240                  const std::string &help,
 
  254   void AddValue (
const std::string &name,
 
  255                  const std::string &help,
 
  264   void AddValue (
const std::string &name,
 
  265                  const std::string &attributePath);
 
  281   void Parse (
int argc, 
char *argv[]);
 
  326     virtual bool Parse (
const std::string value) = 0;
 
  341   template <
typename T>
 
  351     virtual bool Parse (
const std::string value);
 
  373     virtual bool Parse (
const std::string value);
 
  384   void HandleArgument (
const std::string &name, 
const std::string &value) 
const;
 
  392   static bool HandleAttribute (
const std::string name, 
const std::string value);
 
  402   void PrintAttributes (std::ostream &os, 
const std::string &type) 
const;
 
  445 namespace CommandLineHelper {
 
  456   template <
typename T>
 
  470   template <
typename T>
 
  489 template <
typename T>
 
  492                        const std::string &help,
 
  500   std::stringstream ss;
 
  508 template <
typename T>
 
  515 template <
typename T>
 
  519   return CommandLineHelper::GetDefault<T> (*m_valuePtr);
 
  522 template <
typename T>
 
  526   std::ostringstream oss;
 
  532 template <
typename T>
 
  536   return CommandLineHelper::UserItemParse<T> (value, *m_valuePtr);
 
  539 template <
typename T>
 
  543   std::istringstream iss;
 
  546   return !iss.bad () && !iss.fail ();
 
~CommandLine()
Destructor. 
 
T * m_valuePtr
Pointer to the POD location. 
 
Items m_items
The list of arguments. 
 
std::string m_default
String representation of default value. 
 
void PrintGlobals(std::ostream &os) const 
Handler for --PrintGlobals: print all global variables and values. 
 
virtual bool Parse(const std::string value)
Parse from a string. 
 
An argument Item assigning to POD. 
 
virtual bool Parse(const std::string value)=0
Parse from a string. 
 
std::string GetDefault< bool >(const bool &val)
Helper to specialize CommandLine::UserItem::GetDefault() on bool. 
 
std::list< Item * > Items
Argument list container. 
 
std::string GetName() const 
Get the program name. 
 
void Usage(const std::string usage)
Supply the program usage and documentation. 
 
Declaration of the various callback functions. 
 
void Clear(void)
Remove all arguments, Usage(), name. 
 
void PrintAttributes(std::ostream &os, const std::string &type) const 
Handler for --PrintAttributes: print the attributes for a given type. 
 
An argument Item using a Callback to parse the input. 
 
void PrintHelp(std::ostream &os) const 
Print program usage to the desired output stream. 
 
static bool HandleAttribute(const std::string name, const std::string value)
Callback function to handle attributes. 
 
std::string m_usage
The Usage string. 
 
virtual std::string GetDefault() const 
 
std::string m_name
The program name. 
 
Parse command-line arguments. 
 
virtual bool Parse(const std::string value)
Parse from a string. 
 
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output 
 
void PrintGroups(std::ostream &os) const 
Handler for --PrintGroups: print all TypeId group names. 
 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
 
std::string GetDefault(const T &val)
Helper to specialize CommandLine::UserItem::GetDefault() on bool. 
 
CommandLine & operator=(const CommandLine &cmd)
Assignment. 
 
std::string m_name
Argument label: ---m_name=... 
 
bool UserItemParse< bool >(const std::string value, bool &val)
Helpers to specialize CommandLine::UserItem::Parse() on bool. 
 
Callback< bool, std::string > m_callback
The Callback. 
 
virtual bool HasDefault() const 
 
virtual ~Item()
Destructor. 
 
std::string m_help
Argument help string. 
 
CommandLine()
Constructor. 
 
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD. 
 
std::string GetDefault() const 
 
void PrintTypeIds(std::ostream &os) const 
Handler for --PrintTypeIds: print all TypeId names. 
 
void Copy(const CommandLine &cmd)
Copy constructor. 
 
void PrintGroup(std::ostream &os, const std::string &group) const 
Handler for --PrintGroup: print all types belonging to a given group. 
 
void Parse(int argc, char *argv[])
Parse the program arguments. 
 
bool UserItemParse(const std::string value, T &val)
Helpers to specialize CommandLine::UserItem::Parse() on bool. 
 
void HandleArgument(const std::string &name, const std::string &value) const 
Match name against the program or general arguments, and dispatch to the appropriate handler...