Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
util
inc
WireCellUtil
IFactory.h
Go to the documentation of this file.
1
#ifndef WIRECELL_IFACTORY
2
#define WIRECELL_IFACTORY
3
4
#include "
WireCellUtil/IComponent.h
"
5
6
namespace
WireCell
{
7
8
class
IFactory
:
public
IComponent
<IFactory> {
9
public
:
10
virtual
~IFactory
();
11
12
/// Create an instance of what we know how to create.
13
virtual
Interface::pointer
create
() = 0;
14
15
/// Return existing instance or nullptr if not found.
16
virtual
Interface::pointer
find
(
const
std::string
&
name
) = 0;
17
};
18
19
class
INamedFactory
:
public
IFactory
{
20
public
:
21
22
typedef
std::shared_ptr<INamedFactory>
pointer
;
23
24
virtual
~
INamedFactory
();
25
26
/// Set name of class this factory can make
27
virtual
void
set_classname(
const
std::string
&
name
) = 0;
28
/// Access name of class this factory can make
29
virtual
const
std::string
& classname() = 0;
30
31
/// Create an instance by name.
32
virtual
Interface::pointer
create
(
const
std::string
&
name
) = 0;
33
using
IFactory::create
;
34
35
/// Return existing instance or nullptr if not found.
36
virtual
Interface::pointer
find
(
const
std::string
&
name
) = 0;
37
38
};
39
40
}
41
42
#endif
43
name
static QCString name
Definition:
declinfo.cpp:673
string
std::string string
Definition:
nybbler.cc:12
WireCell::IComponent
Definition:
IComponent.h:29
WireCell::INamedFactory::pointer
std::shared_ptr< INamedFactory > pointer
Definition:
IFactory.h:22
IComponent.h
WireCell::IFactory::create
virtual Interface::pointer create()=0
Create an instance of what we know how to create.
WireCell::Interface::pointer
std::shared_ptr< Interface > pointer
Definition:
Interface.h:16
WireCell
Definition:
Main.h:22
WireCell::IFactory::find
virtual Interface::pointer find(const std::string &name)=0
Return existing instance or nullptr if not found.
WireCell::IFactory
Definition:
IFactory.h:8
WireCell::IFactory::~IFactory
virtual ~IFactory()
Definition:
WireCellUtil.cxx:7
WireCell::INamedFactory
Definition:
IFactory.h:19
Generated by
1.8.11