Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sacado_Fad_MemPoolManager.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 #ifndef SACADO_FAD_MEMPOOLMANAGER_HPP
33 #define SACADO_FAD_MEMPOOLMANAGER_HPP
34 
35 #include <map>
36 
37 #include "Sacado_Fad_MemPool.hpp"
38 
39 namespace Sacado {
40 
41  namespace Fad {
42 
44  template <typename T>
46 
47  public:
48 
50  MemPoolManager(unsigned int nfad);
51 
54 
56  MemPool* getMemoryPool(unsigned int dim);
57 
58  private:
59 
62 
65 
66  protected:
67 
69  unsigned int num_fad;
70 
72  typedef std::map<unsigned int, MemPool*> MapType;
73 
76 
77  };
78 
79  } // namespace Fad
80 
81 } // namespace Sacado
82 
83 // Include implementation
85 
86 #endif // SACADO_FAD_MEMPOOLMANAGER_HPP
MemPool * getMemoryPool(unsigned int dim)
Get memory pool for supplied dimension dim.
MapType poolMap
Map of memory pools.
std::map< unsigned int, MemPool * > MapType
Typename of memory pool map.
Class to manage memory pools for different Fad dimensions.
unsigned int num_fad
Number of Fad objects per chunk.
MemPoolManager(unsigned int nfad)
Constructor.
MemPoolManager & operator=(const MemPoolManager &)
Private to prohibit copying.