Rosetta  2020.46
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
protocols::topology_broker::TopologyClaimerFactory Class Reference

A non-copyable factory for instantiating TopologyClaimers by name. Commonly used TopologyClaimers are registered in the constructor. Additional claimers can be registered after the fact using the add_type() method. APL Question: Should this be one-instance-per-program (singleton) or one-instance-per-job? More...

#include <TopologyClaimerFactory.hh>

Inheritance diagram for protocols::topology_broker::TopologyClaimerFactory:
Inheritance graph
[legend]

Public Member Functions

TopologyClaimerOP newTopologyClaimer (const std::string &name) const
 Returns a new instance of the TopologyClaimer identified by <name> More...
 
void add_type (const std::string &name, TopologyClaimerOP claimer)
 Registers the TopologyClaimer with name <name>. Instances of this class can be retrieved by calling newTopologyClaimer(<name>). More...
 
void add_type (TopologyClaimerOP claimer)
 Registers the TopologyClaimer using the name returned by claimer->type(). Instances of this class can be retrieved by calling newTopologyClaimer(<name>). More...
 

Private Member Functions

 TopologyClaimerFactory ()
 Constructs a new instance and initializes the lookup table <claimers_> with commonly used types. More...
 
 TopologyClaimerFactory (TopologyClaimerFactory const &)=delete
 
TopologyClaimerFactoryoperator= (TopologyClaimerFactory const &)=delete
 
 ~TopologyClaimerFactory ()
 Frees resources associated with this object. More...
 

Private Attributes

std::map< std::string,
TopologyClaimerOP
claimers_
 A map that associates claimer names with claimer types. Used by the newTopologyClaimer() method to instantiate new claimers by name. More...
 

Friends

class utility::SingletonBase< TopologyClaimerFactory >
 

Detailed Description

A non-copyable factory for instantiating TopologyClaimers by name. Commonly used TopologyClaimers are registered in the constructor. Additional claimers can be registered after the fact using the add_type() method. APL Question: Should this be one-instance-per-program (singleton) or one-instance-per-job?

Constructor & Destructor Documentation

protocols::topology_broker::TopologyClaimerFactory::TopologyClaimerFactory ( )
private

Constructs a new instance and initializes the lookup table <claimers_> with commonly used types.

References add_type().

protocols::topology_broker::TopologyClaimerFactory::TopologyClaimerFactory ( TopologyClaimerFactory const &  )
privatedelete
protocols::topology_broker::TopologyClaimerFactory::~TopologyClaimerFactory ( )
privatedefault

Frees resources associated with this object.

Member Function Documentation

void protocols::topology_broker::TopologyClaimerFactory::add_type ( const std::string &  name,
TopologyClaimerOP  claimer 
)

Registers the TopologyClaimer with name <name>. Instances of this class can be retrieved by calling newTopologyClaimer(<name>).

References claimers_.

Referenced by add_type(), and TopologyClaimerFactory().

void protocols::topology_broker::TopologyClaimerFactory::add_type ( TopologyClaimerOP  claimer)

Registers the TopologyClaimer using the name returned by claimer->type(). Instances of this class can be retrieved by calling newTopologyClaimer(<name>).

References add_type().

TopologyClaimerOP protocols::topology_broker::TopologyClaimerFactory::newTopologyClaimer ( const std::string &  name) const

Returns a new instance of the TopologyClaimer identified by <name>

References claimers_.

TopologyClaimerFactory& protocols::topology_broker::TopologyClaimerFactory::operator= ( TopologyClaimerFactory const &  )
privatedelete

Friends And Related Function Documentation

friend class utility::SingletonBase< TopologyClaimerFactory >
friend

Member Data Documentation

std::map<std::string, TopologyClaimerOP> protocols::topology_broker::TopologyClaimerFactory::claimers_
mutableprivate

A map that associates claimer names with claimer types. Used by the newTopologyClaimer() method to instantiate new claimers by name.

Referenced by add_type(), and newTopologyClaimer().


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