BOSS 7.0.4
BESIII Offline Software System
|
Factory for all Issues. More...
#include <IssueFactory.h>
Public Types | |
typedef Issue *(* | CreateIssueCallback) () |
typedef std::map< std::string, CreateIssueCallback > | CallbackMap |
typedef Issue *(* | CreateIssueCallback) () |
typedef std::map< std::string, CreateIssueCallback > | CallbackMap |
Public Member Functions | |
bool | register_issue (const std::string &name, CreateIssueCallback creator) |
register an issue factory | |
Issue * | build (const std::string &name) const |
build an empty issue out of a name | |
Issue * | build (const std::string &name, const string_map_type *values) const |
build a issue out of name and set values | |
Issue * | build (const Issue *original) |
build a clone of an issue | |
void | write_to (std::ostream &stream) const |
writes description to stream | |
bool | register_issue (const std::string &name, CreateIssueCallback creator) |
register an issue factory | |
Issue * | build (const std::string &name) const |
build an empty issue out of a name | |
Issue * | build (const std::string &name, const string_map_type *values) const |
build a issue out of name and set values | |
Issue * | build (const Issue *original) |
build a clone of an issue | |
void | write_to (std::ostream &stream) const |
writes description to stream | |
Static Public Member Functions | |
static IssueFactory * | instance () |
method to access singleton | |
static void | print_registered () |
prints all registered issue types | |
static IssueFactory * | instance () |
method to access singleton | |
static void | print_registered () |
prints all registered issue types | |
Protected Member Functions | |
IssueFactory () | |
IssueFactory () | |
Protected Attributes | |
CallbackMap | m_factory_map |
Static Protected Attributes | |
static IssueFactory * | s_factory = 0 |
Factory for all Issues.
This class implements the factory pattern for Issues. The main responsability of this class is to keep track of the existing types of Issues Each issue should register one factory method for instances of this class. This is needed for deserializing of Issues.
Definition at line 31 of file Event/ers/ers-00-00-03/ers/IssueFactory.h.
typedef std::map<std::string,CreateIssueCallback> ers::IssueFactory::CallbackMap |
Definition at line 34 of file Event/ers/ers-00-00-03/ers/IssueFactory.h.
typedef std::map<std::string,CreateIssueCallback> ers::IssueFactory::CallbackMap |
Definition at line 34 of file InstallArea/include/ers/ers/IssueFactory.h.
typedef Issue *(* ers::IssueFactory::CreateIssueCallback) () |
Definition at line 33 of file Event/ers/ers-00-00-03/ers/IssueFactory.h.
typedef Issue *(* ers::IssueFactory::CreateIssueCallback) () |
Definition at line 33 of file InstallArea/include/ers/ers/IssueFactory.h.
|
protected |
Definition at line 21 of file IssueFactory.cxx.
|
protected |
ers::Issue * ers::IssueFactory::build | ( | const Issue * | original | ) |
build a clone of an issue
Clones an Issue. This method creates (using the other build methods) an new Issue with the same value table
original | the Issue to be cloned |
Definition at line 91 of file IssueFactory.cxx.
ers::Issue * ers::IssueFactory::build | ( | const std::string & | name | ) | const |
build an empty issue out of a name
Builds an issue out of the name it was registered with
name | the name used to indentify the class |
name
or DefaultIssue Definition at line 57 of file IssueFactory.cxx.
Referenced by ers::Issue::clone().
Issue * ers::IssueFactory::build | ( | const std::string & | name | ) | const |
build an empty issue out of a name
ers::Issue * ers::IssueFactory::build | ( | const std::string & | name, |
const string_map_type * | values | ||
) | const |
build a issue out of name and set values
Builds an issue out of a name and a value table
name | the name used to indentify the class |
values | the value-table containing the state for the Issue |
Definition at line 76 of file IssueFactory.cxx.
Issue * ers::IssueFactory::build | ( | const std::string & | name, |
const string_map_type * | values | ||
) | const |
build a issue out of name and set values
|
static |
method to access singleton
Finds the singleton instance of the factory. If the instance is not allocated yet, it is.
Definition at line 28 of file IssueFactory.cxx.
Referenced by ers::Issue::clone().
|
static |
method to access singleton
|
static |
prints all registered issue types
Definition at line 35 of file IssueFactory.cxx.
|
static |
prints all registered issue types
bool ers::IssueFactory::register_issue | ( | const std::string & | name, |
CreateIssueCallback | creator | ||
) |
register an issue factory
Register an issue type with the factory
name | the name that will be used to lookup new instances |
creator | a pointer to the function used to create new instance for that particular type of function |
true
if the name was already present in the table Definition at line 47 of file IssueFactory.cxx.
bool ers::IssueFactory::register_issue | ( | const std::string & | name, |
CreateIssueCallback | creator | ||
) |
register an issue factory
void ers::IssueFactory::write_to | ( | std::ostream & | stream | ) | const |
writes description to stream
Definition at line 100 of file IssueFactory.cxx.
void ers::IssueFactory::write_to | ( | std::ostream & | stream | ) | const |
writes description to stream
|
protected |
Definition at line 37 of file Event/ers/ers-00-00-03/ers/IssueFactory.h.
|
staticprotected |
Definition at line 38 of file Event/ers/ers-00-00-03/ers/IssueFactory.h.