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:
4
server/modules/filter/cache/cacheconfig.cc
vendored
4
server/modules/filter/cache/cacheconfig.cc
vendored
@ -146,8 +146,8 @@ config::ParamBool CacheConfig::s_enabled(
|
||||
true
|
||||
);
|
||||
|
||||
CacheConfig::CacheConfig()
|
||||
: config::Configuration(&s_specification)
|
||||
CacheConfig::CacheConfig(const std::string& name)
|
||||
: config::Configuration(name, &s_specification)
|
||||
, storage(this, &s_storage)
|
||||
, storage_options(this, &s_storage_options)
|
||||
, hard_ttl(this, &s_hard_ttl)
|
||||
|
2
server/modules/filter/cache/cacheconfig.hh
vendored
2
server/modules/filter/cache/cacheconfig.hh
vendored
@ -38,7 +38,7 @@ const cache_thread_model CACHE_DEFAULT_THREAD_MODEL = CACHE_THREAD_MODEL_ST;
|
||||
class CacheConfig : public config::Configuration
|
||||
{
|
||||
public:
|
||||
CacheConfig();
|
||||
CacheConfig(const std::string& name);
|
||||
~CacheConfig();
|
||||
|
||||
CacheConfig(const CacheConfig&) = delete;
|
||||
|
5
server/modules/filter/cache/cachefilter.cc
vendored
5
server/modules/filter/cache/cachefilter.cc
vendored
@ -144,7 +144,8 @@ extern "C" MXS_MODULE* MXS_CREATE_MODULE()
|
||||
// CacheFilter
|
||||
//
|
||||
|
||||
CacheFilter::CacheFilter()
|
||||
CacheFilter::CacheFilter(const std::string& name)
|
||||
: m_config(name)
|
||||
{
|
||||
}
|
||||
|
||||
@ -155,7 +156,7 @@ CacheFilter::~CacheFilter()
|
||||
// static
|
||||
CacheFilter* CacheFilter::create(const char* zName, MXS_CONFIG_PARAMETER* ppParams)
|
||||
{
|
||||
CacheFilter* pFilter = new CacheFilter;
|
||||
CacheFilter* pFilter = new CacheFilter(zName);
|
||||
|
||||
if (pFilter)
|
||||
{
|
||||
|
2
server/modules/filter/cache/cachefilter.hh
vendored
2
server/modules/filter/cache/cachefilter.hh
vendored
@ -49,7 +49,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
CacheFilter();
|
||||
CacheFilter(const std::string& name);
|
||||
|
||||
CacheFilter(const CacheFilter&);
|
||||
CacheFilter& operator=(const CacheFilter&);
|
||||
|
Reference in New Issue
Block a user