49 const std::string ¶m_name,
50 std::string &value)
const
52 return iniFile.find(object_name, param_name, value);
57 const std::string ¶m_name,
61 bool ret =
iniFile.find(object_name, param_name, value);
74 const std::string ¶m_name,
75 std::unordered_map<std::string, std::string> &values)
const
82 assert(vec_values.size() % 2 == 0);
85 for (
auto idx = 0; idx < vec_values.size(); idx+=2) {
86 const std::string &key = vec_values[idx];
87 const std::string &
val = vec_values[idx + 1];
89 panic_if(values.find(key) != values.end(),
90 "Key %s already present in Dict", key);
100 const std::string &port_name,
109 return iniFile.sectionExists(
object);
125 if (return_paths && object_name !=
"root") {
126 for (
auto i = children.begin();
i != children.end(); ++
i)
127 *
i = object_name +
"." + *
i;
bool getParamDict(const std::string &object_name, const std::string ¶m_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 argu...
bool objectExists(const std::string &object_name) const
Does an object with this path exist?
bool getParamVector(const std::string &object_name, const std::string ¶m_name, std::vector< std::string > &values) const
Get a list/vector parameter.
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 load(const std::string &filename)
Load config file.
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.
void getAllObjectNames(std::vector< std::string > &list) const
Get all SimObjects in the config.
bool getParam(const std::string &object_name, const std::string ¶m_name, std::string &value) const
Get a single parameter value as a string returned in value.
.ini file reading wrapper for use with CxxConfigManager
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Copyright (c) 2024 Arm Limited All rights reserved.
void tokenize(std::vector< std::string > &v, const std::string &s, char token, bool ignore)