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 // $Id$
2 // $Source$
3 // @HEADER
4 // ***********************************************************************
5 //
6 // Sacado Package
7 // Copyright (2006) Sandia Corporation
8 //
9 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
10 // the U.S. Government retains certain rights in this software.
11 //
12 // This library is free software; you can redistribute it and/or modify
13 // it under the terms of the GNU Lesser General Public License as
14 // published by the Free Software Foundation; either version 2.1 of the
15 // License, or (at your option) any later version.
16 //
17 // This library is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 // Lesser General Public License for more details.
21 //
22 // You should have received a copy of the GNU Lesser General Public
23 // License along with this library; if not, write to the Free Software
24 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
25 // USA
26 // Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps
27 // (etphipp@sandia.gov).
28 //
29 // ***********************************************************************
30 // @HEADER
31 
32 template <typename TypeSeq, typename BaseT, typename ObjectT>
35 {
36  // Determine number of types
38  objects.resize(sz);
39 }
40 
41 template <typename TypeSeq, typename BaseT, typename ObjectT>
44 {
45 }
46 
47 template <typename TypeSeq, typename BaseT, typename ObjectT>
48 template <typename BuilderOpT>
49 void
51 buildObjects(const BuilderOpT& builder)
52 {
54 }
55 
56 template <typename TypeSeq, typename BaseT, typename ObjectT>
57 void
60 {
61  DefaultBuilderOp builder;
62  (*this).template buildObjects<DefaultBuilderOp>(builder);
63 }
64 
65 template <typename TypeSeq, typename BaseT, typename ObjectT>
66 template<typename ScalarT>
70 {
72  return objects[idx];
73 }
74 
75 template <typename TypeSeq, typename BaseT, typename ObjectT>
76 template<typename ScalarT>
79 {
81  return objects[idx];
82 }
83 
84 template <typename TypeSeq, typename BaseT, typename ObjectT>
85 template<typename ScalarT>
89 {
91  return Teuchos::rcp_dynamic_cast< typename Sacado::mpl::apply<ObjectT,ScalarT>::type >(objects[idx], true);
92 }
93 
94 template <typename TypeSeq, typename BaseT, typename ObjectT>
95 template<typename ScalarT>
98 getAsObject() const
99 {
101  return Teuchos::rcp_dynamic_cast< const typename Sacado::mpl::apply<ObjectT,ScalarT>::type >(objects[idx], true);
102 }
103 
104 template <typename TypeSeq, typename BaseT, typename ObjectT>
108 {
109  return Sacado::TemplateIterator<BaseT>(objects.begin());
110 }
111 
112 template <typename TypeSeq, typename BaseT, typename ObjectT>
115 begin() const
116 {
117  return Sacado::ConstTemplateIterator<BaseT>(objects.begin());
118 }
119 
120 template <typename TypeSeq, typename BaseT, typename ObjectT>
124 {
125  return Sacado::TemplateIterator<BaseT>(objects.end());
126 }
127 
128 template <typename TypeSeq, typename BaseT, typename ObjectT>
131 end() const
132 {
133  return Sacado::ConstTemplateIterator<BaseT>(objects.end());
134 }
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.