My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
TemplateNodeFactory Class Reference

Factory class for creating tag AST nodes found in a template. More...

Classes

class  AutoRegister
 Helper class for registering a template AST node. More...
 

Public Types

typedef TemplateNode *(* CreateFunc )(TemplateParser *parser, TemplateNode *parent, int line, const QCString &data)
 

Public Member Functions

TemplateNodecreate (const QCString &name, TemplateParser *parser, TemplateNode *parent, int line, const QCString &data)
 
void registerTemplateNode (const QCString &name, CreateFunc func)
 

Static Public Member Functions

static TemplateNodeFactoryinstance ()
 

Private Attributes

QDict< void > m_registry
 

Detailed Description

Factory class for creating tag AST nodes found in a template.

Definition at line 4490 of file template.cpp.

Member Typedef Documentation

typedef TemplateNode*(* TemplateNodeFactory::CreateFunc)(TemplateParser *parser, TemplateNode *parent, int line, const QCString &data)

Definition at line 4493 of file template.cpp.

Member Function Documentation

TemplateNode* TemplateNodeFactory::create ( const QCString &  name,
TemplateParser parser,
TemplateNode parent,
int  line,
const QCString &  data 
)
inline

Definition at line 4505 of file template.cpp.

References m_registry.

{
if (m_registry.find(name)==0) return 0;
return ((CreateFunc)m_registry[name])(parser,parent,line,data);
}
static TemplateNodeFactory* TemplateNodeFactory::instance ( )
inlinestatic

Definition at line 4498 of file template.cpp.

Referenced by TemplateNodeFactory::AutoRegister< T >::AutoRegister(), and TemplateParser::parse().

{
if (instance==0) instance = new TemplateNodeFactory;
return instance;
}
void TemplateNodeFactory::registerTemplateNode ( const QCString &  name,
CreateFunc  func 
)
inline

Definition at line 4515 of file template.cpp.

References m_registry.

Referenced by TemplateNodeFactory::AutoRegister< T >::AutoRegister().

{
m_registry.insert(name,(void*)func);
}

Member Data Documentation

QDict<void> TemplateNodeFactory::m_registry
private

Definition at line 4531 of file template.cpp.

Referenced by create(), and registerTemplateNode().


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