Rosetta Protocols  2014.16.56682
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | 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. More...

#include <TopologyClaimerFactory.hh>

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...
 

Static Public Member Functions

static TopologyClaimerFactory
const & 
get_instance ()
 Returns an instance to the singleton. More...
 

Private Member Functions

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

Static Private Member Functions

static TopologyClaimerFactorycreate_singleton_instance ()
 private singleton creation function to be used with utility::thread::threadsafe_singleton 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...
 

Static Private Attributes

static TopologyClaimerFactoryinstance_
 A pointer to the singleton instance of the factory object. Resources associated with the object are released on destruction. APL Question: Should this be one-instance-per-program (singleton) or one-instance-per-job? More...
 

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.

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().

Referenced by create_singleton_instance().

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

Frees resources associated with this object.

References instance_.

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().

TopologyClaimerFactory * protocols::topology_broker::TopologyClaimerFactory::create_singleton_instance ( )
staticprivate

private singleton creation function to be used with utility::thread::threadsafe_singleton

References TopologyClaimerFactory().

Referenced by get_instance().

TopologyClaimerFactory const & protocols::topology_broker::TopologyClaimerFactory::get_instance ( )
static

Returns an instance to the singleton.

static function to get the instance of ( pointer to) this singleton class

References create_singleton_instance(), instance_, and utility::thread::safely_create_singleton().

Referenced by protocols::topology_broker::add_claims_from_stream().

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

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

References claimers_, ss, and utility_exit_with_message.

Referenced by protocols::topology_broker::add_claims_from_stream().

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().

TopologyClaimerFactory * protocols::topology_broker::TopologyClaimerFactory::instance_
staticprivate

A pointer to the singleton instance of the factory object. Resources associated with the object are released on destruction. APL Question: Should this be one-instance-per-program (singleton) or one-instance-per-job?

Referenced by get_instance(), and ~TopologyClaimerFactory().


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