MXS-2556 Make config::Configuration aware of its object
The name of the object (i.e. the section name from the configuration file), is now stored in the configuration object for that object. That way, more contextual and hence morfe user friendly errors and warnings can be generated.
This commit is contained in:
@ -385,11 +385,17 @@ void Param::populate(MXS_MODULE_PARAM& param) const
|
||||
/**
|
||||
* class Configuration
|
||||
*/
|
||||
Configuration::Configuration(const config::Specification* pSpecification)
|
||||
: m_specification(*pSpecification)
|
||||
Configuration::Configuration(const std::string& name, const config::Specification* pSpecification)
|
||||
: m_name(name)
|
||||
, m_specification(*pSpecification)
|
||||
{
|
||||
}
|
||||
|
||||
const std::string& Configuration::name() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
const config::Specification& Configuration::specification() const
|
||||
{
|
||||
return m_specification;
|
||||
|
@ -338,7 +338,7 @@ int main()
|
||||
|
||||
specification.document(cout);
|
||||
|
||||
config::Configuration configuration(&specification);
|
||||
config::Configuration configuration("test", &specification);
|
||||
|
||||
int nErrors = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user