Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sacado_TemplateManagerImp.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Sacado Package
4 //
5 // Copyright 2006 NTESS and the Sacado contributors.
6 // SPDX-License-Identifier: LGPL-2.1-or-later
7 // *****************************************************************************
8 // @HEADER
9 
10 template <typename TypeSeq, typename BaseT, typename ObjectT>
13 {
14  // Determine number of types
16  objects.resize(sz);
17 }
18 
19 template <typename TypeSeq, typename BaseT, typename ObjectT>
22 {
23 }
24 
25 template <typename TypeSeq, typename BaseT, typename ObjectT>
26 template <typename BuilderOpT>
27 void
29 buildObjects(const BuilderOpT& builder)
30 {
32 }
33 
34 template <typename TypeSeq, typename BaseT, typename ObjectT>
35 void
38 {
39  DefaultBuilderOp builder;
40  (*this).template buildObjects<DefaultBuilderOp>(builder);
41 }
42 
43 template <typename TypeSeq, typename BaseT, typename ObjectT>
44 template<typename ScalarT>
48 {
50  return objects[idx];
51 }
52 
53 template <typename TypeSeq, typename BaseT, typename ObjectT>
54 template<typename ScalarT>
57 {
59  return objects[idx];
60 }
61 
62 template <typename TypeSeq, typename BaseT, typename ObjectT>
63 template<typename ScalarT>
67 {
69  return Teuchos::rcp_dynamic_cast< typename Sacado::mpl::apply<ObjectT,ScalarT>::type >(objects[idx], true);
70 }
71 
72 template <typename TypeSeq, typename BaseT, typename ObjectT>
73 template<typename ScalarT>
76 getAsObject() const
77 {
79  return Teuchos::rcp_dynamic_cast< const typename Sacado::mpl::apply<ObjectT,ScalarT>::type >(objects[idx], true);
80 }
81 
82 template <typename TypeSeq, typename BaseT, typename ObjectT>
86 {
87  return Sacado::TemplateIterator<BaseT>(objects.begin());
88 }
89 
90 template <typename TypeSeq, typename BaseT, typename ObjectT>
93 begin() const
94 {
95  return Sacado::ConstTemplateIterator<BaseT>(objects.begin());
96 }
97 
98 template <typename TypeSeq, typename BaseT, typename ObjectT>
102 {
103  return Sacado::TemplateIterator<BaseT>(objects.end());
104 }
105 
106 template <typename TypeSeq, typename BaseT, typename ObjectT>
109 end() const
110 {
111  return Sacado::ConstTemplateIterator<BaseT>(objects.end());
112 }
Teuchos::RCP< typename Sacado::mpl::apply< ObjectT, ScalarT >::type > getAsObject()
Get RCP to object corrensponding to ScalarT as ObjectT&lt;ScalarT&gt;
TemplateManager()
Default constructor.
F::template apply< A1, A2, A3, A4, A5 >::type type
void buildObjects()
Build objects for each ScalarT using default builder.
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.
Sacado::TemplateManager< TypeSeq, BaseT, ObjectT >::iterator begin()
Return an iterator that points to the first type object.