gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
gem5::CxxIniFile Class Reference

CxxConfigManager interface for using .ini files. More...

#include <cxx_config_ini.hh>

Inheritance diagram for gem5::CxxIniFile:
gem5::CxxConfigFileBase

Public Member Functions

 CxxIniFile ()
 
bool getParam (const std::string &object_name, const std::string &param_name, std::string &value) const
 Get a single parameter value as a string returned in value.
 
bool getParamVector (const std::string &object_name, const std::string &param_name, std::vector< std::string > &values) const
 Get a list/vector parameter.
 
bool getParamDict (const std::string &object_name, const std::string &param_name, std::unordered_map< std::string, std::string > &values) const
 Finds the dictionary parameter of the object in the ini file and unserializes it into the values argument which is passed by reference.
 
bool getPortPeers (const std::string &object_name, const std::string &port_name, std::vector< std::string > &peers) const
 Get the peer (connected) ports of the named ports.
 
bool objectExists (const std::string &object_name) const
 Does an object with this path exist?
 
void getAllObjectNames (std::vector< std::string > &list) const
 Get all SimObjects in the config.
 
void getObjectChildren (const std::string &object_name, std::vector< std::string > &children, bool return_paths=false) const
 Get the names or paths of all the children SimObjects of this SimObject.
 
bool load (const std::string &filename)
 Load config file.
 
- Public Member Functions inherited from gem5::CxxConfigFileBase
 CxxConfigFileBase ()
 
virtual ~CxxConfigFileBase ()
 
virtual CxxConfigParams::Flags getFlags () const
 Get the flags which should be used to modify parameter parsing behaviour.
 

Protected Attributes

IniFile iniFile
 

Detailed Description

CxxConfigManager interface for using .ini files.

Definition at line 58 of file cxx_config_ini.hh.

Constructor & Destructor Documentation

◆ CxxIniFile()

gem5::CxxIniFile::CxxIniFile ( )
inline

Definition at line 64 of file cxx_config_ini.hh.

Member Function Documentation

◆ getAllObjectNames()

void gem5::CxxIniFile::getAllObjectNames ( std::vector< std::string > & list) const
virtual

Get all SimObjects in the config.

Implements gem5::CxxConfigFileBase.

Definition at line 113 of file cxx_config_ini.cc.

References iniFile.

◆ getObjectChildren()

void gem5::CxxIniFile::getObjectChildren ( const std::string & object_name,
std::vector< std::string > & children,
bool return_paths = false ) const
virtual

Get the names or paths of all the children SimObjects of this SimObject.

If return_paths is true then full paths are returned. If false, only the last name component for each object is returned

Implements gem5::CxxConfigFileBase.

Definition at line 119 of file cxx_config_ini.cc.

References getParamVector(), and gem5::ArmISA::i.

◆ getParam()

bool gem5::CxxIniFile::getParam ( const std::string & object_name,
const std::string & param_name,
std::string & value ) const
virtual

Get a single parameter value as a string returned in value.

For booleans, the function expects "true" or "false" in value. For NULL SimObjects, it expects "Null"

Implements gem5::CxxConfigFileBase.

Definition at line 48 of file cxx_config_ini.cc.

References iniFile.

◆ getParamDict()

bool gem5::CxxIniFile::getParamDict ( const std::string & object_name,
const std::string & param_name,
std::unordered_map< std::string, std::string > & values ) const
virtual

Finds the dictionary parameter of the object in the ini file and unserializes it into the values argument which is passed by reference.

Implements gem5::CxxConfigFileBase.

Definition at line 73 of file cxx_config_ini.cc.

References getParamVector(), panic_if, and gem5::X86ISA::val.

◆ getParamVector()

bool gem5::CxxIniFile::getParamVector ( const std::string & object_name,
const std::string & param_name,
std::vector< std::string > & values ) const
virtual

Get a list/vector parameter.

Implements gem5::CxxConfigFileBase.

Definition at line 56 of file cxx_config_ini.cc.

References iniFile, and gem5::tokenize().

Referenced by getObjectChildren(), getParamDict(), and getPortPeers().

◆ getPortPeers()

bool gem5::CxxIniFile::getPortPeers ( const std::string & object_name,
const std::string & port_name,
std::vector< std::string > & peers ) const
virtual

Get the peer (connected) ports of the named ports.

Implements gem5::CxxConfigFileBase.

Definition at line 99 of file cxx_config_ini.cc.

References getParamVector().

◆ load()

bool gem5::CxxIniFile::load ( const std::string & filename)
virtual

Load config file.

Implements gem5::CxxConfigFileBase.

Definition at line 132 of file cxx_config_ini.cc.

References iniFile.

◆ objectExists()

bool gem5::CxxIniFile::objectExists ( const std::string & object_name) const
virtual

Does an object with this path exist?

Implements gem5::CxxConfigFileBase.

Definition at line 107 of file cxx_config_ini.cc.

References iniFile.

Member Data Documentation

◆ iniFile

IniFile gem5::CxxIniFile::iniFile
protected

Definition at line 61 of file cxx_config_ini.hh.

Referenced by getAllObjectNames(), getParam(), getParamVector(), load(), and objectExists().


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

Generated on Mon May 26 2025 09:19:20 for gem5 by doxygen 1.13.2