DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
Implements factory pattern for user defined Issues. More...
#include <IssueFactory.hpp>
Public Member Functions | |
Issue * | create (const std::string &name, const Context &context) const |
build an empty issue for a given name | |
Issue * | create (const std::string &name, const std::list< std::string > &inheritance, const Context &context, Severity severity, const system_clock::time_point &time, const std::string &message, const std::vector< std::string > &qualifiers, const std::map< std::string, std::string > ¶meters, const Issue *cause=0) const |
build issue out of all the given parameters | |
void | register_issue (const std::string &name, IssueCreator creator) |
register an issue factory | |
Static Public Member Functions | |
static IssueFactory & | instance () |
method to access singleton | |
Private Types | |
typedef Issue *(*) | IssueCreator(const ers::Context &) |
typedef std::map< std::string, IssueCreator > | FunctionMap |
Private Member Functions | |
IssueFactory () | |
Private Attributes | |
FunctionMap | m_creators |
Friends | |
template<class > | |
class | SingletonCreator |
Implements factory pattern for user defined Issues.
This class implements factory pattern for Issues. The main responsibility of this class is to keep track of the existing types of Issues Each user defined issue class should register one factory method for creating instances of this class. This is required for reconstructing issues produced in the context of a different process.
Definition at line 44 of file IssueFactory.hpp.
|
private |
Definition at line 49 of file IssueFactory.hpp.
|
private |
Definition at line 48 of file IssueFactory.hpp.
|
inlineprivate |
Definition at line 70 of file IssueFactory.hpp.
ers::Issue * ers::IssueFactory::create | ( | const std::string & | name, |
const Context & | context ) const |
build an empty issue for a given name
Builds an issue out of the name it was registered with
name | the name used to indentify the class |
name
or AnyIssue Definition at line 49 of file IssueFactory.cpp.
Issue * ers::IssueFactory::create | ( | const std::string & | name, |
const std::list< std::string > & | inheritance, | ||
const Context & | context, | ||
Severity | severity, | ||
const system_clock::time_point & | time, | ||
const std::string & | message, | ||
const std::vector< std::string > & | qualifiers, | ||
const std::map< std::string, std::string > & | parameters, | ||
const Issue * | cause = 0 ) const |
build issue out of all the given parameters
|
static |
method to access singleton
Returns the singleton instance of the factory.
Definition at line 22 of file IssueFactory.cpp.
void ers::IssueFactory::register_issue | ( | const std::string & | name, |
IssueCreator | 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 |
Definition at line 34 of file IssueFactory.cpp.
|
friend |
Definition at line 46 of file IssueFactory.hpp.
|
private |
Definition at line 73 of file IssueFactory.hpp.