WireCellToolkit
Wire Cell Simulation, Signal Process and Reconstruction Toolki for Liquid Argon Detectors
WireCell::NamedFactory< Type > Class Template Reference

#include <NamedFactory.h>

Inheritance diagram for WireCell::NamedFactory< Type >:
Collaboration diagram for WireCell::NamedFactory< Type >:

Public Types

typedef Type type
 Remember the underlying type. More...
 
typedef std::shared_ptr< Type > pointer_type
 The exposed pointer type. More...
 
- Public Types inherited from WireCell::INamedFactory
typedef std::shared_ptr< INamedFactorypointer
 
- Public Types inherited from WireCell::IComponent< IFactory >
typedef std::shared_ptr< IFactorypointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 
- Public Types inherited from WireCell::Interface
typedef std::shared_ptr< Interfacepointer
 

Public Member Functions

 NamedFactory ()
 
Interface::pointer find (const std::string &name)
 Return existing instance of given name or nullptr if not found. More...
 
Interface::pointer create ()
 Return an instance associated with the given name. More...
 
Interface::pointer create (const std::string &name)
 Create an instance by name. More...
 
virtual void set_classname (const std::string &name)
 Set name of class this factory can make. More...
 
virtual const std::string & classname ()
 Access name of class this factory can make. More...
 
- Public Member Functions inherited from WireCell::INamedFactory
virtual ~INamedFactory ()
 
- Public Member Functions inherited from WireCell::IFactory
virtual ~IFactory ()
 
- Public Member Functions inherited from WireCell::IComponent< IFactory >
virtual ~IComponent ()
 
- Public Member Functions inherited from WireCell::Interface
virtual ~Interface ()
 

Detailed Description

template<class Type>
class WireCell::NamedFactory< Type >

A templated factory of objects of type Type that associates a name to an object, returning a preexisting one if it exists.

Definition at line 27 of file NamedFactory.h.

Member Typedef Documentation

◆ pointer_type

template<class Type>
typedef std::shared_ptr<Type> WireCell::NamedFactory< Type >::pointer_type

The exposed pointer type.

Definition at line 33 of file NamedFactory.h.

◆ type

template<class Type>
typedef Type WireCell::NamedFactory< Type >::type

Remember the underlying type.

Definition at line 30 of file NamedFactory.h.

Constructor & Destructor Documentation

◆ NamedFactory()

template<class Type>
WireCell::NamedFactory< Type >::NamedFactory ( )
inline

Definition at line 35 of file NamedFactory.h.

Member Function Documentation

◆ classname()

template<class Type>
virtual const std::string& WireCell::NamedFactory< Type >::classname ( )
inlinevirtual

Access name of class this factory can make.

Implements WireCell::INamedFactory.

Definition at line 59 of file NamedFactory.h.

◆ create() [1/2]

template<class Type>
Interface::pointer WireCell::NamedFactory< Type >::create ( )
inlinevirtual

Return an instance associated with the given name.

Implements WireCell::IFactory.

Definition at line 47 of file NamedFactory.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [2/2]

template<class Type>
Interface::pointer WireCell::NamedFactory< Type >::create ( const std::string &  name)
inlinevirtual

Create an instance by name.

Implements WireCell::INamedFactory.

Definition at line 48 of file NamedFactory.h.

◆ find()

template<class Type>
Interface::pointer WireCell::NamedFactory< Type >::find ( const std::string &  name)
inlinevirtual

Return existing instance of given name or nullptr if not found.

Implements WireCell::INamedFactory.

Definition at line 38 of file NamedFactory.h.

◆ set_classname()

template<class Type>
virtual void WireCell::NamedFactory< Type >::set_classname ( const std::string &  name)
inlinevirtual

Set name of class this factory can make.

Implements WireCell::INamedFactory.

Definition at line 58 of file NamedFactory.h.


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