32 #ifndef SACADO_TEMPLATEMANAGER_HPP 33 #define SACADO_TEMPLATEMANAGER_HPP 38 #include "Teuchos_RCP.hpp" 70 template <
typename TypeSeq,
typename BaseT,
typename ObjectT>
75 bool operator() (
const std::type_info*
a,
const std::type_info* b) {
80 template <
typename BuilderOpT>
82 std::vector< Teuchos::RCP<BaseT> >*
objects;
85 const BuilderOpT& builder_) :
89 (*objects)[idx] =
builder.template build<T>();
105 template<
class ScalarT>
108 return Teuchos::rcp( dynamic_cast<BaseT*>(
new type ) );
120 template <
typename BuilderOpT>
127 template<
typename ScalarT>
131 template<
typename ScalarT>
132 Teuchos::RCP<const BaseT>
getAsBase()
const;
135 template<
typename ScalarT>
136 Teuchos::RCP< typename Sacado::mpl::apply<ObjectT,ScalarT>::type >
getAsObject();
139 template<
typename ScalarT>
140 Teuchos::RCP< const typename Sacado::mpl::apply<ObjectT,ScalarT>::type >
getAsObject()
const;
ConstTemplateIterator< BaseT > const_iterator
Typedef for const_iterator.
std::vector< Teuchos::RCP< BaseT > > objects
Stores array of rcp's to objects of each type.
std::vector< Teuchos::RCP< BaseT > > * objects
~TemplateManager()
Destructor.
Teuchos::RCP< typename Sacado::mpl::apply< ObjectT, ScalarT >::type > getAsObject()
Get RCP to object corrensponding to ScalarT as ObjectT<ScalarT>
TemplateManager()
Default constructor.
lambda< F >::type ::template apply< A1, A2, A3, A4, A5 >::type type
void buildObjects()
Build objects for each ScalarT using default builder.
Container class to manager template instantiations of a template class.
TemplateIterator< BaseT > iterator
Typedef for iterator.
The default builder class for building objects for each ScalarT.
Teuchos::RCP< BaseT > getAsBase()
Get RCP to object corrensponding to ScalarT as BaseT.
Sacado::TemplateManager< TypeSeq, BaseT, ObjectT >::iterator end()
Return an iterator that points one past the last type object.
const BuilderOpT & builder
BuildObject(std::vector< Teuchos::RCP< BaseT > > &objects_, const BuilderOpT &builder_)
bool operator()(const std::type_info *a, const std::type_info *b)
Implementation of < for type_info objects.
Teuchos::RCP< BaseT > build() const
Returns a new rcp for an object of type ObjectT<ScalarT>
Sacado::TemplateManager< TypeSeq, BaseT, ObjectT >::iterator begin()
Return an iterator that points to the first type object.