Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | 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>

Inheritance diagram for protocols::topology_broker::TopologyClaimerFactory:
Inheritance graph
[legend]
Collaboration diagram for protocols::topology_broker::TopologyClaimerFactory:
Collaboration 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...
 

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

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_ = NULL
 A pointer to the singleton instance of the factory object. Resources associated with the object are released on destruction. 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 get_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 const & protocols::topology_broker::TopologyClaimerFactory::get_instance ( )
static

Returns an instance to the singleton.

References instance_, and TopologyClaimerFactory().

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

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_ = NULL
staticprivate

A pointer to the singleton instance of the factory object. Resources associated with the object are released on destruction.

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


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