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

Factory singleton for registering and creating filters. More...

Classes

class  AutoRegister
 Helper class for registering a filter function. More...
 

Public Types

typedef TemplateVariantFilterFunction) (const TemplateVariant &v, const TemplateVariant &arg)
 

Public Member Functions

TemplateVariant apply (const QCString &name, const TemplateVariant &v, const TemplateVariant &arg, bool &ok)
 
void registerFilter (const QCString &name, FilterFunction *func)
 

Static Public Member Functions

static TemplateFilterFactoryinstance ()
 

Private Attributes

QDict< void > m_registry
 

Detailed Description

Factory singleton for registering and creating filters.

Definition at line 1292 of file template.cpp.

Member Typedef Documentation

typedef TemplateVariant( TemplateFilterFactory::FilterFunction) (const TemplateVariant &v, const TemplateVariant &arg)

Definition at line 1295 of file template.cpp.

Member Function Documentation

TemplateVariant TemplateFilterFactory::apply ( const QCString name,
const TemplateVariant v,
const TemplateVariant arg,
bool ok 
)
inline

Definition at line 1304 of file template.cpp.

1305  {
1306  FilterFunction *func = (FilterFunction*)m_registry.find(name);
1307  if (func)
1308  {
1309  ok=TRUE;
1310  return (*func)(v,arg);
1311  }
1312  else
1313  {
1314  ok=FALSE;
1315  return v;
1316  }
1317  }
QDict< void > m_registry
Definition: template.cpp:1335
const bool FALSE
Definition: qglobal.h:370
TemplateVariant( FilterFunction)(const TemplateVariant &v, const TemplateVariant &arg)
Definition: template.cpp:1295
def func()
Definition: docstring.py:7
const bool TRUE
Definition: qglobal.h:371
static TemplateFilterFactory* TemplateFilterFactory::instance ( )
inlinestatic

Definition at line 1297 of file template.cpp.

1298  {
1299  static TemplateFilterFactory *instance = 0;
1300  if (instance==0) instance = new TemplateFilterFactory;
1301  return instance;
1302  }
static TemplateFilterFactory * instance()
Definition: template.cpp:1297
Factory singleton for registering and creating filters.
Definition: template.cpp:1292
void TemplateFilterFactory::registerFilter ( const QCString name,
FilterFunction func 
)
inline

Definition at line 1319 of file template.cpp.

1320  {
1321  m_registry.insert(name,(void*)func);
1322  }
QDict< void > m_registry
Definition: template.cpp:1335
def func()
Definition: docstring.py:7

Member Data Documentation

QDict<void> TemplateFilterFactory::m_registry
private

Definition at line 1335 of file template.cpp.


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