anatomist 6.0.18
3D neuroimaging data viewer
anatomist::Registry Class Reference

Registry links all Command concrete subclasses with a function that will read the guts of the command and create an instance of the subclass. More...

#include <anatomist/processor/Registry.h>

Public Member Functions

 ~Registry ()
 
const carto::SyntaxSet & syntax () const
 
bool add (const std::string &command, Command::Reader function, const carto::SyntaxSet &syntax)
 Register a \Ref{Command} subclass and link with a function will read the guts from a stream and create an instance of it.
 
Command * create (const Tree &command, CommandContext *context) const
 Creates a command with given characteristics provided as a Tree.
 

Static Public Member Functions

static Registry * instance ()
 Access the unique instance of Registry.
 

Protected Member Functions

 Registry ()
 Singleton constructor cannot be accessed by the programmer.
 

Detailed Description

Registry links all Command concrete subclasses with a function that will read the guts of the command and create an instance of the subclass.

Because there has to be only one registry, Registry implements the Singleton pattern:

Definition at line 67 of file Registry.h.

Constructor & Destructor Documentation

◆ ~Registry()

anatomist::Registry::~Registry ( )

◆ Registry()

anatomist::Registry::Registry ( )
protected

Singleton constructor cannot be accessed by the programmer.

References Registry().

Referenced by instance(), and Registry().

Member Function Documentation

◆ add()

bool anatomist::Registry::add ( const std::string & command,
Command::Reader function,
const carto::SyntaxSet & syntax )

Register a \Ref{Command} subclass and link with a function will read the guts from a stream and create an instance of it.

Parameters
commandname under which the class will be registered

References syntax().

◆ create()

Command * anatomist::Registry::create ( const Tree & command,
CommandContext * context ) const

Creates a command with given characteristics provided as a Tree.

◆ instance()

static Registry * anatomist::Registry::instance ( )
static

Access the unique instance of Registry.

Returns
always the same unique instance of Registry

References Registry().

◆ syntax()

const carto::SyntaxSet & anatomist::Registry::syntax ( ) const
inline

Definition at line 78 of file Registry.h.

Referenced by add().


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