ns3::ConfigStore Class Reference

Store and load simulation attribute configuration. More...

#include <config-store.h>

Inheritance diagram for ns3::ConfigStore:
Inheritance graph
[legend]
Collaboration diagram for ns3::ConfigStore:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual TypeId GetInstanceTypeId (void) const
 ConfigStore ()
void Configure (void)

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::ConfigStore.

Private Member Functions

void LoadFrom (std::string filename)
void StoreTo (std::string filename)

Private Attributes

std::string m_loadFilename
std::string m_storeFilename

Detailed Description

Store and load simulation attribute configuration.

While it is possible to generate a sample config file and lightly edit it to change a couple of values, there are cases where this process will not work because the same value on the same object can appear multiple times in the same automatically-generated configuration file under different configuration paths.

As such, the best way to use this class is to use it to generate an initial configuration file, extract from that configuration file only the strictly necessary elements, and move these minimal elements to a new configuration file which can then safely be edited. Another option is to use the ns3::GtkConfigStore class which will allow you to edit the parameters and will generate configuration files where all the instances of the same parameter are changed.

Definition at line 26 of file config-store.h.


Constructor & Destructor Documentation

ns3::ConfigStore::ConfigStore (  ) 

Definition at line 44 of file config-store.cc.

References ns3::ObjectBase::ConstructSelf().


Member Function Documentation

void ns3::ConfigStore::Configure ( void   ) 

Depending on which attribute was set:

  • Store simulation configuration in file and exit
  • Load simulation configuration from file and proceed.

Definition at line 75 of file config-store.cc.

References LoadFrom(), m_loadFilename, m_storeFilename, and StoreTo().

TypeId ns3::ConfigStore::GetInstanceTypeId ( void   )  const [virtual]
Returns:
the TypeId associated to the most-derived type of this instance.

This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.

Implements ns3::ObjectBase.

Definition at line 38 of file config-store.cc.

References GetTypeId().

TypeId ns3::ConfigStore::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::ConfigStore.

Attributes defined for this type:

  • LoadFilename: The file where the configuration should be loaded from.
    • Set with class: StringValue
    • Underlying type: std::string
    • Initial value:
    • Flags: construct write read
  • StoreFilename: The file where the configuration should be stored to.
    • Set with class: StringValue
    • Underlying type: std::string
    • Initial value:
    • Flags: construct write read

No TraceSources defined for this type.

Reimplemented from ns3::ObjectBase.

Definition at line 20 of file config-store.cc.

References m_loadFilename, m_storeFilename, and ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

void ns3::ConfigStore::LoadFrom ( std::string  filename  )  [private]

Definition at line 50 of file config-store.cc.

References NS_LOG_DEBUG, and ns3::Config::Set().

Referenced by Configure().

void ns3::ConfigStore::StoreTo ( std::string  filename  )  [private]

Definition at line 63 of file config-store.cc.

References ns3::TextFileAttributeIterator::Save().

Referenced by Configure().


Member Data Documentation

std::string ns3::ConfigStore::m_loadFilename [private]

Definition at line 45 of file config-store.h.

Referenced by Configure(), and GetTypeId().

std::string ns3::ConfigStore::m_storeFilename [private]

Definition at line 46 of file config-store.h.

Referenced by Configure(), and GetTypeId().


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:10:01 2009 for NS-3 by  doxygen 1.6.3