00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef LOCA_PARAMETER_LIBRARY_H
00043 #define LOCA_PARAMETER_LIBRARY_H
00044
00045 #include "Teuchos_RCP.hpp"
00046
00047 #include "NOX_Common.H"
00048
00049 namespace LOCA {
00050
00051 namespace Parameter {
00052
00053
00054
00055
00056 class AbstractEntry;
00057
00058
00059 template <class ValueType> class Entry;
00060
00076 class Library {
00077
00079 typedef map<string, AbstractEntry*> ValueTypeMap;
00080
00082 typedef ValueTypeMap::const_iterator ValueTypeMapConstIterator;
00083
00085 typedef ValueTypeMap::iterator ValueTypeMapIterator;
00086
00088 typedef map<string, ValueTypeMap*> ParameterMap;
00089
00091 typedef ParameterMap::const_iterator ParameterMapConstIterator;
00092
00094 typedef ParameterMap::iterator ParameterMapIterator;
00095
00096 public:
00097
00099 Library() : library() {}
00100
00102 ~Library();
00103
00105 template <class ValueType>
00106 void setValue(const string& name, const ValueType& value);
00107
00109 template <class ValueType>
00110 ValueType getValue(const string& name) const;
00111
00113
00117 template <class ObjectType, class ValueType>
00118 bool addParameterEntry(const string& name, ObjectType& object,
00119 ValueType ObjectType::* object_val_ptr);
00120
00122
00126 template <class FunctorType, class ValueType>
00127 bool addParameterEntry(const string& name, FunctorType* fctr);
00128
00130
00134 template <class ValueType>
00135 bool addParameterEntry(const string& name,
00136 Entry<ValueType>* entry);
00137
00138 protected:
00139
00140
00141
00142
00144 Library(const Library& l);
00145
00147 Library& operator = (const Library& l);
00148
00153 ParameterMapIterator getEntryMapIterator(const string& name);
00154
00159 ParameterMapConstIterator getEntryMapIterator(const string& name) const;
00160
00167 ValueTypeMapIterator getEntryIterator(
00168 const string& valueTypeString,
00169 const ParameterMapIterator& paramIterator);
00170
00177 ValueTypeMapConstIterator getEntryIterator(
00178 const string& valueTypeString,
00179 const ParameterMapConstIterator& paramIterator) const;
00180
00185 template <class ValueType>
00186 Entry<ValueType>& getEntry(const string& name);
00187
00192 template <class ValueType>
00193 const Entry<ValueType>& getEntry(const string& name) const;
00194
00196 template <class ValueType> string getTypeName() const;
00197
00198 protected:
00199
00201 ParameterMap library;
00202
00203 };
00204 }
00205 }
00206
00207
00208 #include "LOCA_Parameter_LibraryT.H"
00209
00210 #endif