Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ConfigContext Class Reference

#include <context.h>

Inheritance diagram for ConfigContext:
RefCountedContext TemplateStructIntf

Classes

class  Private
 

Public Member Functions

virtual TemplateVariant get (const char *name) const
 
virtual int addRef ()
 
virtual int release ()
 
- Public Member Functions inherited from RefCountedContext
 RefCountedContext (const char *)
 
virtual ~RefCountedContext ()
 
int addRef ()
 
int release ()
 
- Public Member Functions inherited from TemplateStructIntf
virtual ~TemplateStructIntf ()
 

Static Public Member Functions

static ConfigContextalloc ()
 

Private Member Functions

 ConfigContext ()
 
 ~ConfigContext ()
 

Private Attributes

Privatep
 

Detailed Description

Definition at line 129 of file context.h.

Constructor & Destructor Documentation

ConfigContext::ConfigContext ( )
private

Definition at line 320 of file context.cpp.

320  : RefCountedContext("ConfigContext")
321 {
322  p = new Private;
323 }
Definition: types.h:26
RefCountedContext(const char *)
Definition: context.h:109
Private * p
Definition: context.h:142
ConfigContext::~ConfigContext ( )
private

Definition at line 325 of file context.cpp.

326 {
327  delete p;
328 }
Private * p
Definition: context.h:142

Member Function Documentation

virtual int ConfigContext::addRef ( )
inlinevirtual

Increase object's reference count

Implements TemplateStructIntf.

Definition at line 136 of file context.h.

136 { return RefCountedContext::addRef(); }
static ConfigContext* ConfigContext::alloc ( )
inlinestatic

Definition at line 132 of file context.h.

132 { return new ConfigContext; }
TemplateVariant ConfigContext::get ( const char *  name) const
virtual

Gets the value for a field name.

Parameters
[in]nameThe name of the field.

Implements TemplateStructIntf.

Definition at line 330 of file context.cpp.

331 {
333  if (name)
334  {
335  ConfigOption *option = Config::instance()->get(name);
336  if (option)
337  {
338  switch (option->kind())
339  {
341  return TemplateVariant(*((ConfigBool*)option)->valueRef());
342  case ConfigOption::O_Int:
343  return TemplateVariant(*((ConfigInt*)option)->valueRef());
345  return TemplateVariant(*((ConfigEnum*)option)->valueRef());
347  return TemplateVariant(*((ConfigString*)option)->valueRef());
349  return p->fetchList(name,((ConfigList*)option)->valueRef());
350  break;
351  default:
352  break;
353  }
354  }
355  }
356  return result;
357 }
static QCString name
Definition: declinfo.cpp:673
static QCString result
const std::string instance
Private * p
Definition: context.h:142
OptionType kind() const
Definition: config.h:65
Variant type which can hold one value of a fixed set of types.
Definition: template.h:90
TemplateVariant fetchList(const QCString &name, const QStrList *list)
Definition: context.cpp:295
virtual int ConfigContext::release ( )
inlinevirtual

Decreases object's referenc count, destroy object if 0

Implements TemplateStructIntf.

Definition at line 137 of file context.h.

137 { return RefCountedContext::release(); }

Member Data Documentation

Private* ConfigContext::p
private

Definition at line 142 of file context.h.


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