Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::Configuration Class Reference
Inheritance diagram for Arcane::Configuration:
Collaboration diagram for Arcane::Configuration:

Classes

struct  ConfigValue

Public Member Functions

 Configuration (ConfigurationMng *cm, ITraceMng *tm)
IConfigurationSectioncreateSection (const String &name) const override
 Creates a configuration section.
IConfigurationSectionmainSection () const override
 Main section.
void addValue (const String &name, const String &value, Integer priority) override
 Adds a value to the configuration.
IConfigurationclone () const override
 Clones this configuration.
void merge (const IConfiguration *c) override
 Merges this configuration with configuration c.
void dump () const override
 Displays the values of the configuration parameters via traceMng().
void dump (std::ostream &o) const override
 Displays the values of the configuration parameters to the stream o.
template<typename T>
getValue (const String &base_name, const String &name, T default_value) const
Public Member Functions inherited from Arcane::TraceAccessor
 TraceAccessor (ITraceMng *m)
 Constructs an accessor via the trace manager m.
 TraceAccessor (const TraceAccessor &rhs)
 Copy constructor.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () const
 Trace manager.
TraceMessage info () const
 Flow for an information message.
TraceMessage pinfo () const
 Flow for a parallel information message.
TraceMessage info (char category) const
 Flow for an information message of a given category.
TraceMessage pinfo (char category) const
 Flow for a parallel information message of a given category.
TraceMessage info (bool v) const
 Flow for an information message.
TraceMessage warning () const
 Flow for a warning message.
TraceMessage pwarning () const
TraceMessage error () const
 Flow for an error message.
TraceMessage perror () const
TraceMessage log () const
 Flow for a log message.
TraceMessage plog () const
 Flow for a log message.
TraceMessage logdate () const
 Flow for a log message preceded by the date.
TraceMessage fatal () const
 Flow for a fatal error message.
TraceMessage pfatal () const
 Flow for a parallel fatal error message.
TraceMessageDbg debug (Trace::eDebugLevel=Trace::Medium) const
 Flow for a debug message.
Trace::eDebugLevel configDbgLevel () const
 Debug level of the configuration file.
TraceMessage info (Int32 verbose_level) const
 Flow for an information message of a given level.
TraceMessage linfo () const
 Flow for an information message with the local information level of this instance.
TraceMessage linfo (Int32 relative_level) const
 Flow for an information message with the local information level of this instance.
void fatalMessage (const StandaloneTraceMessage &o) const
Public Member Functions inherited from Arcane::IConfiguration
virtual ~IConfiguration ()
 Frees resources.

Private Types

typedef std::map< String, ConfigValueKeyValueMap

Private Member Functions

void _checkAdd (const String &name, const String &value, Integer priority)

Static Private Member Functions

static const char * _typeName (Int32 *)
static const char * _typeName (Int64 *)
static const char * _typeName (Real *)
static const char * _typeName (bool *)
static const char * _typeName (String *)

Private Attributes

ConfigurationMngm_configuration_mng
KeyValueMap m_values
ScopedPtrT< IConfigurationSectionm_main_section

Additional Inherited Members

Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const

Detailed Description

Definition at line 126 of file Configuration.cc.

Member Typedef Documentation

◆ KeyValueMap

typedef std::map<String, ConfigValue> Arcane::Configuration::KeyValueMap
private

Definition at line 145 of file Configuration.cc.

Constructor & Destructor Documentation

◆ Configuration()

Arcane::Configuration::Configuration ( ConfigurationMng * cm,
ITraceMng * tm )

Definition at line 268 of file Configuration.cc.

Member Function Documentation

◆ _checkAdd()

void Arcane::Configuration::_checkAdd ( const String & name,
const String & value,
Integer priority )
inlineprivate

Definition at line 195 of file Configuration.cc.

◆ _typeName() [1/5]

const char * Arcane::Configuration::_typeName ( bool * )
inlinestaticprivate

Definition at line 192 of file Configuration.cc.

◆ _typeName() [2/5]

const char * Arcane::Configuration::_typeName ( Int32 * )
inlinestaticprivate

Definition at line 189 of file Configuration.cc.

◆ _typeName() [3/5]

const char * Arcane::Configuration::_typeName ( Int64 * )
inlinestaticprivate

Definition at line 190 of file Configuration.cc.

◆ _typeName() [4/5]

const char * Arcane::Configuration::_typeName ( Real * )
inlinestaticprivate

Definition at line 191 of file Configuration.cc.

◆ _typeName() [5/5]

const char * Arcane::Configuration::_typeName ( String * )
inlinestaticprivate

Definition at line 193 of file Configuration.cc.

◆ addValue()

void Arcane::Configuration::addValue ( const String & name,
const String & value,
Integer priority )
overridevirtual

Adds a value to the configuration.

Adds the value value for the name name to the configuration. The new value will have priority priority. If a value for name name already exists, it is replaced by value if priority is lower than the current priority.

Implements Arcane::IConfiguration.

Definition at line 336 of file Configuration.cc.

◆ clone()

IConfiguration * Arcane::Configuration::clone ( ) const
overridevirtual

Clones this configuration.

Implements Arcane::IConfiguration.

Definition at line 279 of file Configuration.cc.

References Arcane::TraceAccessor::traceMng().

Here is the call graph for this function:

◆ createSection()

IConfigurationSection * Arcane::Configuration::createSection ( const String & name) const
inlineoverridevirtual

Creates a configuration section.

The returned instance must be destroyed by the delete operator.

Implements Arcane::IConfiguration.

Definition at line 153 of file Configuration.cc.

◆ dump() [1/2]

void Arcane::Configuration::dump ( ) const
overridevirtual

Displays the values of the configuration parameters via traceMng().

Implements Arcane::IConfiguration.

Definition at line 294 of file Configuration.cc.

References dump(), and Arcane::TraceAccessor::info().

Referenced by dump().

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

◆ dump() [2/2]

void Arcane::Configuration::dump ( std::ostream & ostr) const
overridevirtual

Displays the values of the configuration parameters to the stream o.

Implements Arcane::IConfiguration.

Definition at line 305 of file Configuration.cc.

◆ getValue()

template<typename T>
T Arcane::Configuration::getValue ( const String & base_name,
const String & name,
T default_value ) const
inline

Definition at line 168 of file Configuration.cc.

◆ mainSection()

IConfigurationSection * Arcane::Configuration::mainSection ( ) const
inlineoverridevirtual

Main section.

The returned instance remains the property of this instance and should not be destroyed.

Implements Arcane::IConfiguration.

Definition at line 158 of file Configuration.cc.

◆ merge()

void Arcane::Configuration::merge ( const IConfiguration * c)
overridevirtual

Merges this configuration with configuration c.

If an option exists in both this configuration and c, the one with the lowest priority is kept.

Implements Arcane::IConfiguration.

Definition at line 319 of file Configuration.cc.

References ARCANE_CHECK_POINTER.

Member Data Documentation

◆ m_configuration_mng

ConfigurationMng* Arcane::Configuration::m_configuration_mng
private

Definition at line 215 of file Configuration.cc.

◆ m_main_section

ScopedPtrT<IConfigurationSection> Arcane::Configuration::m_main_section
private

Definition at line 217 of file Configuration.cc.

◆ m_values

KeyValueMap Arcane::Configuration::m_values
private

Definition at line 216 of file Configuration.cc.


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