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

Command mapper. More...

Classes

struct  Cmd
 

Static Public Member Functions

static Cmdmap (const char *name)
 
static void freeInstance ()
 

Private Member Functions

 DocCmdMapper ()
 
Cmdfind (const char *name)
 

Static Private Member Functions

static DocCmdMapperinstance ()
 

Private Attributes

QDict< Cmdm_map
 

Static Private Attributes

static DocCmdMappers_instance =0
 

Detailed Description

Command mapper.

Maps a command name (as found in a comment block) onto a specific handler function.

Definition at line 3387 of file commentscan.cpp.

Constructor & Destructor Documentation

DocCmdMapper::DocCmdMapper ( )
inlineprivate

Definition at line 3415 of file commentscan.cpp.

3415  : m_map(113)
3416  {
3417  m_map.setAutoDelete(TRUE);
3418  DocCmdMap *p = docCmdMap;
3419  while (p->cmdName)
3420  {
3421  if (m_map.find(p->cmdName)!=0)
3422  {
3423  err("DocCmdMapper: command %s already added\n",p->cmdName);
3424  exit(1);
3425  }
3426  Cmd *cmd = new Cmd;
3427  cmd->func = p->handler;
3428  cmd->endsBrief = p->endsBrief;
3429  m_map.insert(p->cmdName,cmd);
3430  p++;
3431  }
3432  }
QDict< Cmd > m_map
DocCmdFunc handler
static DocCmdMap docCmdMap[]
p
Definition: test.py:223
void err(const char *fmt,...)
Definition: message.cpp:226
list cmd
Definition: getreco.py:22
const bool TRUE
Definition: qglobal.h:371
const char * cmdName

Member Function Documentation

Cmd* DocCmdMapper::find ( const char *  name)
inlineprivate

Definition at line 3434 of file commentscan.cpp.

3435  {
3436  return m_map.find(name);
3437  }
static QCString name
Definition: declinfo.cpp:673
QDict< Cmd > m_map
static void DocCmdMapper::freeInstance ( )
inlinestatic

release the singleton

Definition at line 3403 of file commentscan.cpp.

3404  {
3405  delete s_instance; s_instance=0;
3406  }
static DocCmdMapper * s_instance
static DocCmdMapper* DocCmdMapper::instance ( )
inlinestaticprivate

Definition at line 3409 of file commentscan.cpp.

3410  {
3411  if (s_instance==0) s_instance = new DocCmdMapper;
3412  return s_instance;
3413  }
static DocCmdMapper * s_instance
static Cmd* DocCmdMapper::map ( const char *  name)
inlinestatic

maps a command name to a handler function

Definition at line 3397 of file commentscan.cpp.

3398  {
3399  return instance()->find(name);
3400  }
static QCString name
Definition: declinfo.cpp:673
static DocCmdMapper * instance()
Cmd * find(const char *name)

Member Data Documentation

QDict<Cmd> DocCmdMapper::m_map
private

Definition at line 3438 of file commentscan.cpp.

DocCmdMapper * DocCmdMapper::s_instance =0
staticprivate

Definition at line 3439 of file commentscan.cpp.


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