Doxygen
ConfigContext::Private类 参考
+ ConfigContext::Private 的协作图:

Public 成员函数

StringVector fields () const
 
TemplateVariant get (const QCString &name) const
 

Private 类型

using ConfigData = std::map< std::string, TemplateVariant >
 

Private 成员函数

ConfigData createConfigData () const
 
StringVector createFields () const
 

Private 属性

CachedItem< StringVector, Private, &Private::createFieldsm_fields
 
CachedItem< ConfigData, Private, &Private::createConfigDatam_configData
 

详细描述

在文件 context.cpp236 行定义.

成员类型定义说明

◆ ConfigData

using ConfigContext::Private::ConfigData = std::map<std::string,TemplateVariant>
private

在文件 context.cpp251 行定义.

成员函数说明

◆ createConfigData()

ConfigData ConfigContext::Private::createConfigData ( ) const
inlineprivate

在文件 context.cpp253 行定义.

254  {
255  std::map<std::string,TemplateVariant> map;
256  for (auto name : ConfigValues::instance().fields())
257  {
258  const ConfigValues::Info *option = ConfigValues::instance().get(QCString(name));
259  if (option)
260  {
261  switch (option->type)
262  {
263  case ConfigValues::Info::Bool:
264  {
265  bool b = ConfigValues::instance().*(option->value.b);
266  map.insert(std::make_pair(name,TemplateVariant(b)));
267  }
268  break;
269  case ConfigValues::Info::Int:
270  {
271  int i = ConfigValues::instance().*(option->value.i);
272  map.insert(std::make_pair(name,TemplateVariant(i)));
273  }
274  break;
275  case ConfigValues::Info::String:
276  {
277  QCString s = ConfigValues::instance().*(option->value.s);
278  map.insert(std::make_pair(name,TemplateVariant(s)));
279  }
280  break;
281  case ConfigValues::Info::List:
282  {
283  auto fetchList = [](const StringVector &list) -> TemplateVariant
284  {
285  TemplateVariantList elements;
286  elements.reserve(list.size());
287  for (const auto &s : list)
288  {
289  elements.push_back(TemplateVariant(s));
290  }
291  return TemplateImmutableList::alloc(elements);
292  };
293  const StringVector &l = ConfigValues::instance().*(option->value.l);
294  map.insert(std::make_pair(name,fetchList(l)));
295  }
296  break;
297  default:
298  break;
299  }
300  }
301  }
302  return map;
303  }

引用了 TemplateImmutableList::alloc(), fields() , 以及 QCString::insert().

◆ createFields()

StringVector ConfigContext::Private::createFields ( ) const
inlineprivate

在文件 context.cpp305 行定义.

306  {
307  return ConfigValues::instance().fields();
308  }

◆ fields()

StringVector ConfigContext::Private::fields ( ) const
inline

在文件 context.cpp240 行定义.

241  {
242  return m_fields.get(this);
243  }

引用了 m_fields.

被这些函数引用 createConfigData().

◆ get()

TemplateVariant ConfigContext::Private::get ( const QCString name) const
inline

在文件 context.cpp244 行定义.

245  {
246  auto &data = m_configData.get(this);
247  auto it = data.find(name.str());
248  return (it!=data.end()) ? it->second : TemplateVariant();
249  }

引用了 m_configData , 以及 QCString::str().

类成员变量说明

◆ m_configData

CachedItem<ConfigData, Private, &Private::createConfigData> ConfigContext::Private::m_configData
private

在文件 context.cpp311 行定义.

被这些函数引用 get().

◆ m_fields

CachedItem<StringVector, Private, &Private::createFields > ConfigContext::Private::m_fields
private

在文件 context.cpp310 行定义.

被这些函数引用 fields().


该类的文档由以下文件生成:
StringVector
std::vector< std::string > StringVector
Definition: containers.h:32
TemplateVariantList
std::vector< TemplateVariant > TemplateVariantList
Definition: template.h:261
QCString::str
std::string str() const
Definition: qcstring.h:442
ConfigContext::Private::m_configData
CachedItem< ConfigData, Private, &Private::createConfigData > m_configData
Definition: context.cpp:311
TemplateVariant
Variant type which can hold one value of a fixed set of types.
Definition: template.h:98
QCString::insert
QCString & insert(size_t index, const QCString &s)
Definition: qcstring.h:274
ConfigContext::Private::m_fields
CachedItem< StringVector, Private, &Private::createFields > m_fields
Definition: context.cpp:310
TemplateImmutableList::alloc
static TemplateListIntfPtr alloc(std::initializer_list< TemplateVariant > elements)
Creates an instance and returns a shared pointer to it
Definition: template.cpp:543
ConfigContext::Private::fields
StringVector fields() const
Definition: context.cpp:240
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108