anatomist  5.1.2
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::SyntaxSetsyntax () 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. More...
 
Commandcreate (const Tree &command, CommandContext *context) const
 Creates a command with given characteristics provided as a Tree. More...
 

Static Public Member Functions

static Registryinstance ()
 Access the unique instance of Registry. More...
 

Protected Member Functions

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

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.

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

◆ 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

◆ syntax()

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

Definition at line 78 of file Registry.h.


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