47 #ifndef __Teko_CloneFactory_hpp__
48 #define __Teko_CloneFactory_hpp__
50 #include "Teuchos_RCP.hpp"
66 virtual Teuchos::RCP<Cloneable>
clone()
const = 0;
92 template <
class CloneType,
class BaseType=AutoCloneDummy>
111 virtual Teuchos::RCP<Cloneable>
clone()
const
128 template <
class CloneBaseType>
153 virtual Teuchos::RCP<CloneBaseType>
build(
const std::string & str)
const
155 std::map<std::string,Teuchos::RCP<const Cloneable> >::const_iterator itr
158 return Teuchos::rcp_dynamic_cast<CloneBaseType>(itr->second->clone(),
true);
170 virtual void addClone(
const std::string & str,
const Teuchos::RCP<Cloneable> & clone)
183 std::map<std::string,Teuchos::RCP<const Cloneable> >::const_iterator itr;
185 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.
virtual Teuchos::RCP< CloneBaseType > build(const std::string &str) const
virtual Teuchos::RCP< Cloneable > clone() const
std::map< std::string, Teuchos::RCP< const Cloneable > > parentClones_
stores the clonable objects
virtual Teuchos::RCP< Cloneable > clone() const =0