00001 // $Id: Sacado_ParameterFamilyBase.hpp,v 1.3 2007/07/24 00:08:06 etphipp Exp $ 00002 // $Source: /space/CVS/Trilinos/packages/sacado/src/parameter/Sacado_ParameterFamilyBase.hpp,v $ 00003 // @HEADER 00004 // *********************************************************************** 00005 // 00006 // Sacado Package 00007 // Copyright (2006) Sandia Corporation 00008 // 00009 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00010 // the U.S. Government retains certain rights in this software. 00011 // 00012 // This library is free software; you can redistribute it and/or modify 00013 // it under the terms of the GNU Lesser General Public License as 00014 // published by the Free Software Foundation; either version 2.1 of the 00015 // License, or (at your option) any later version. 00016 // 00017 // This library is distributed in the hope that it will be useful, but 00018 // WITHOUT ANY WARRANTY; without even the implied warranty of 00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 // Lesser General Public License for more details. 00021 // 00022 // You should have received a copy of the GNU Lesser General Public 00023 // License along with this library; if not, write to the Free Software 00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00025 // USA 00026 // Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps 00027 // (etphipp@sandia.gov). 00028 // 00029 // *********************************************************************** 00030 // @HEADER 00031 00032 #ifndef SACADO_PARAMETERFAMILYBASE_HPP 00033 #define SACADO_PARAMETERFAMILYBASE_HPP 00034 00035 #include <map> 00036 #include <string> 00037 00038 #include "Teuchos_RCP.hpp" 00039 00040 namespace Sacado { 00041 00046 template <typename EntryBase, template<typename> class EntryType> 00047 class ParameterFamilyBase { 00048 00049 public: 00050 00052 ParameterFamilyBase(const std::string& name, 00053 bool supports_ad, 00054 bool supports_analytic); 00055 00057 virtual ~ParameterFamilyBase(); 00058 00060 std::string getName() const; 00061 00063 bool supportsAD() const; 00064 00066 bool supportsAnalytic() const; 00067 00069 template <typename ValueType> 00070 bool hasType() const; 00071 00073 00077 template <typename ValueType> 00078 bool addEntry(const Teuchos::RCP< EntryType<ValueType> >& entry); 00079 00081 template <typename ValueType> 00082 Teuchos::RCP< EntryType<ValueType> > getEntry(); 00083 00085 template <typename ValueType> 00086 Teuchos::RCP< const EntryType<ValueType> > getEntry() const; 00087 00089 void printFamily(std::ostream& os) const; 00090 00091 protected: 00092 00094 typedef std::map<std::string, Teuchos::RCP<EntryBase> > ValueMap; 00095 00097 typedef typename ValueMap::const_iterator const_iterator; 00098 00100 typedef typename ValueMap::iterator iterator; 00101 00103 template <class ValueType> std::string getTypeName() const; 00104 00105 private: 00106 00108 ParameterFamilyBase(const ParameterFamilyBase&); 00109 00111 ParameterFamilyBase& operator = (const ParameterFamilyBase&); 00112 00113 protected: 00114 00116 ValueMap family; 00117 00119 const std::string name; 00120 00122 bool supports_ad; 00123 00125 bool supports_analytic; 00126 00127 }; 00128 } 00129 00130 // Include template definitions 00131 #include "Sacado_ParameterFamilyBaseImp.hpp" 00132 00133 #endif
1.4.7