A Discrete-Event Network Simulator
API
ns3::ConfigStore Class Reference


Introspection did not find any typical Config paths. More...

#include "config-store.h"

+ Inheritance diagram for ns3::ConfigStore:
+ Collaboration diagram for ns3::ConfigStore:

Public Types

enum  FileFormat { XML, RAW_TEXT }
 store format More...
 
enum  Mode { LOAD, SAVE, NONE }
 for ConfigStore operation More...
 

Public Member Functions

 ConfigStore ()
 
 ~ConfigStore ()
 
void ConfigureAttributes (void)
 Configure the attribute values. More...
 
void ConfigureDefaults (void)
 Configure the default values. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
void SetFileFormat (enum FileFormat format)
 Set the file format. More...
 
void SetFilename (std::string filename)
 Set the filename. More...
 
void SetMode (enum Mode mode)
 Set the mode of operation. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Attributes

FileConfigm_file
 configuration file More...
 
enum FileFormat m_fileFormat
 store format More...
 
std::string m_filename
 store file name More...
 
enum Mode m_mode
 store mode More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description


Introspection did not find any typical Config paths.


Attributes

  • Mode: Configuration mode
    • Set with class: ns3::EnumValue
    • Underlying type:
    • Initial value: None
    • Flags: construct write
  • Filename: The file where the configuration should be saved to or loaded from.
    • Set with class: StringValue
    • Underlying type:
    • Initial value:
    • Flags: construct write
  • FileFormat: Type of file format
    • Set with class: ns3::EnumValue
    • Underlying type:
    • Initial value: RawText
    • Flags: construct write

No TraceSources are defined for this type.
Size of this type is 32 bytes (on a 64-bit architecture).

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

Member Enumeration Documentation

◆ FileFormat

store format

for ConfigStore operation

file format

Enumerator
XML 
RAW_TEXT 

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

◆ Mode

for ConfigStore operation

store / load mode

Enumerator
LOAD 
SAVE 
NONE 

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

Constructor & Destructor Documentation

◆ ConfigStore()

ns3::ConfigStore::ConfigStore ( )

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

References ns3::ObjectBase::ConstructSelf(), LOAD, m_file, m_fileFormat, m_filename, m_mode, NS_ABORT_MSG, NS_LOG_FUNCTION, RAW_TEXT, SAVE, ns3::FileConfig::SetFilename(), and XML.

+ Here is the call graph for this function:

◆ ~ConfigStore()

ns3::ConfigStore::~ConfigStore ( )

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

References m_file, and NS_LOG_FUNCTION.

Member Function Documentation

◆ ConfigureAttributes()

void ns3::ConfigStore::ConfigureAttributes ( void  )

Configure the attribute values.

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

References ns3::FileConfig::Attributes(), m_file, and NS_LOG_FUNCTION.

Referenced by PrintAttributesIfEnabled().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConfigureDefaults()

void ns3::ConfigStore::ConfigureDefaults ( void  )

Configure the default values.

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

References ns3::FileConfig::Default(), ns3::FileConfig::Global(), m_file, and NS_LOG_FUNCTION.

Referenced by LteIpv6RoutingTestCase::DoRun(), ConfigStoreHelper::LoadConfig(), and ConfigStoreHelper::SaveConfig().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::ConfigStore::GetInstanceTypeId ( void  ) const
virtual

Get the most derived TypeId for this Object.

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

Returns
The TypeId associated to the most-derived type of this instance.

Implements ns3::ObjectBase.

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

References GetTypeId().

+ Here is the call graph for this function:

◆ GetTypeId()

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

Get the type ID.

Returns
the object TypeId

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

References LOAD, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::MakeStringAccessor(), ns3::MakeStringChecker(), NONE, RAW_TEXT, SAVE, SetFileFormat(), SetFilename(), SetMode(), ns3::TypeId::SetParent(), and XML.

Referenced by GetInstanceTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetFileFormat()

void ns3::ConfigStore::SetFileFormat ( enum FileFormat  format)

Set the file format.

Parameters
formatthe file format

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

References m_fileFormat, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetFilename()

void ns3::ConfigStore::SetFilename ( std::string  filename)

Set the filename.

Parameters
filenamethe file name

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

References m_filename, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetMode()

void ns3::ConfigStore::SetMode ( enum Mode  mode)

Set the mode of operation.

Parameters
modemode of operation

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

References m_mode, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_file

FileConfig* ns3::ConfigStore::m_file
private

configuration file

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

Referenced by ConfigStore(), ConfigureAttributes(), ConfigureDefaults(), and ~ConfigStore().

◆ m_fileFormat

enum FileFormat ns3::ConfigStore::m_fileFormat
private

store format

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

Referenced by ConfigStore(), and SetFileFormat().

◆ m_filename

std::string ns3::ConfigStore::m_filename
private

store file name

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

Referenced by ConfigStore(), and SetFilename().

◆ m_mode

enum Mode ns3::ConfigStore::m_mode
private

store mode

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

Referenced by ConfigStore(), and SetMode().


The documentation for this class was generated from the following files: