10 #ifndef __Teko_CloneFactory_hpp__
11 #define __Teko_CloneFactory_hpp__
13 #include "Teuchos_RCP.hpp"
29 virtual Teuchos::RCP<Cloneable>
clone()
const = 0;
55 template <
class CloneType,
class BaseType = AutoCloneDummy>
72 virtual Teuchos::RCP<Cloneable>
clone()
const {
90 template <
class CloneBaseType>
115 virtual Teuchos::RCP<CloneBaseType>
build(
const std::string& str)
const {
116 std::map<std::string, Teuchos::RCP<const Cloneable> >::const_iterator itr =
119 return Teuchos::rcp_dynamic_cast<CloneBaseType>(itr->second->clone(),
true);
131 virtual void addClone(
const std::string& str,
const Teuchos::RCP<Cloneable>& clone) {
143 std::map<std::string, Teuchos::RCP<const Cloneable> >::const_iterator itr;
145 names.push_back(itr->first);
virtual int cloneCount() const
Return the number of clones stored in this factory.
void getCloneNames(std::vector< std::string > &names) const
CloneFactory()
Default constructor.
virtual void addClone(const std::string &str, const Teuchos::RCP< Cloneable > &clone)
CloneFactory(const CloneFactory< CloneBaseType > &cf)
Copy constructor.
std::map< std::string, Teuchos::RCP< const Cloneable > > parentClones_
stores the clonable objects
virtual Teuchos::RCP< CloneBaseType > build(const std::string &str) const
virtual Teuchos::RCP< Cloneable > clone() const
virtual Teuchos::RCP< Cloneable > clone() const =0