CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Friends
edmplugin::PluginFactory< R *(Args...)> Class Template Reference

#include <PluginFactory.h>

Inheritance diagram for edmplugin::PluginFactory< R *(Args...)>:
edmplugin::PluginFactoryBase

Classes

struct  PMaker
 
struct  PMakerBase
 

Public Types

using CreatedType = R
 
using TemplateArgType = R *(Args...)
 
- Public Types inherited from edmplugin::PluginFactoryBase
typedef tbb::concurrent_unordered_map< std::string, PMakersPlugins
 
typedef tbb::concurrent_vector< PluginMakerInfoPMakers
 

Public Member Functions

const std::string & category () const override
 returns the name of the category to which this plugin factory belongs More...
 
R * create (const std::string &iName, Args...args) const
 
void registerPMaker (PMakerBase *iPMaker, const std::string &iName)
 
R * tryToCreate (const std::string &iName, Args...args) const
 like above but returns 0 if iName is unknown More...
 
- Public Member Functions inherited from edmplugin::PluginFactoryBase
virtual std::vector< PluginInfoavailable () const
 return info about all plugins which are already available in the program More...
 
 PluginFactoryBase ()
 
virtual ~PluginFactoryBase ()
 

Static Public Member Functions

static PluginFactory< R *(Args...)> * get ()
 

Private Member Functions

const PluginFactoryoperator= (const PluginFactory &)=delete
 
 PluginFactory ()
 
 PluginFactory (const PluginFactory &)=delete
 

Friends

class DummyFriend
 

Additional Inherited Members

- Public Attributes inherited from edmplugin::PluginFactoryBase
edm::signalslot::Signal< void(const std::string &, const PluginInfo &)> newPluginAdded_
 signal containing plugin category, and plugin info for newly added plugin More...
 
- Protected Member Functions inherited from edmplugin::PluginFactoryBase
void fillAvailable (std::vector< PluginInfo > &iReturn) const
 
void fillInfo (const PMakers &makers, PluginInfo &iInfo, std::vector< PluginInfo > &iReturn) const
 
void * findPMaker (const std::string &iName) const
 
void finishedConstruction ()
 
void newPlugin (const std::string &iName)
 
void registerPMaker (void *iPMaker, const std::string &iName)
 
void * tryToFindPMaker (const std::string &iName) const
 

Detailed Description

template<typename R, typename... Args>
class edmplugin::PluginFactory< R *(Args...)>

Definition at line 37 of file PluginFactory.h.

Member Typedef Documentation

template<typename R , typename... Args>
using edmplugin::PluginFactory< R *(Args...)>::CreatedType = R

Definition at line 42 of file PluginFactory.h.

template<typename R , typename... Args>
using edmplugin::PluginFactory< R *(Args...)>::TemplateArgType = R*(Args...)

Definition at line 41 of file PluginFactory.h.

Constructor & Destructor Documentation

template<typename R , typename... Args>
edmplugin::PluginFactory< R *(Args...)>::PluginFactory ( )
inlineprivate

Definition at line 78 of file PluginFactory.h.

template<typename R , typename... Args>
edmplugin::PluginFactory< R *(Args...)>::PluginFactory ( const PluginFactory< R *(Args...)> &  )
privatedelete

Member Function Documentation

template<typename R , typename... Args>
const std::string& edmplugin::PluginFactory< R *(Args...)>::category ( ) const
overridevirtual

returns the name of the category to which this plugin factory belongs

Implements edmplugin::PluginFactoryBase.

template<typename R , typename... Args>
R* edmplugin::PluginFactory< R *(Args...)>::create ( const std::string &  iName,
Args...  args 
) const
inline

Definition at line 57 of file PluginFactory.h.

References writedatasetfile::args, beamerCreator::create(), and edmplugin::PluginFactoryBase::findPMaker().

57  {
58  return reinterpret_cast<PMakerBase*>(PluginFactoryBase::findPMaker(iName))->create(std::forward<Args>(args)...);
59  }
R * create(const std::string &iName, Args...args) const
Definition: PluginFactory.h:57
void * findPMaker(const std::string &iName) const
template<typename R , typename... Args>
static PluginFactory<R*(Args...)>* edmplugin::PluginFactory< R *(Args...)>::get ( )
static
template<typename R , typename... Args>
const PluginFactory& edmplugin::PluginFactory< R *(Args...)>::operator= ( const PluginFactory< R *(Args...)> &  )
privatedelete
template<typename R , typename... Args>
void edmplugin::PluginFactory< R *(Args...)>::registerPMaker ( PMakerBase *  iPMaker,
const std::string &  iName 
)
inline

Definition at line 73 of file PluginFactory.h.

References edmplugin::PluginFactoryBase::registerPMaker().

73  {
74  PluginFactoryBase::registerPMaker(iPMaker, iName);
75  }
void registerPMaker(void *iPMaker, const std::string &iName)
template<typename R , typename... Args>
R* edmplugin::PluginFactory< R *(Args...)>::tryToCreate ( const std::string &  iName,
Args...  args 
) const
inline

like above but returns 0 if iName is unknown

Definition at line 62 of file PluginFactory.h.

References writedatasetfile::args, beamerCreator::create(), runEdmFileComparison::found, dttmaxenums::R, and edmplugin::PluginFactoryBase::tryToFindPMaker().

62  {
64  if (found == nullptr) {
65  return nullptr;
66  }
67  return reinterpret_cast<PMakerBase*>(found)->create(args...);
68  }
R * create(const std::string &iName, Args...args) const
Definition: PluginFactory.h:57
void * tryToFindPMaker(const std::string &iName) const

Friends And Related Function Documentation

template<typename R , typename... Args>
friend class DummyFriend
friend

Definition at line 38 of file PluginFactory.h.