#include <MemoryManagerOptions.hpp>


Public Types | |
| enum | MatrixType { none, sparse } |
Public Member Functions | |
| MatrixType | matrixType () |
| MemoryManagerOptions () | |
| void | get (IdentifierSet &I) |
| const ReferenceCounting < Parameter > | get (const char *parameterName) const |
| void | reset () |
Static Public Member Functions | |
| static const char * | identifier () |
Protected Member Functions | |
| template<typename EnumType> | |
| void | get (const char *label, EnumType &e) const |
| void | get (const char *label, real_t &d) const |
| void | get (const char *label, int &i) const |
| void | get (const char *label, std::string &s) const |
| void | add (ReferenceCounting< Parameter > p) |
Private Member Functions | |
| std::ostream & | put (std::ostream &os) const |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const ParametrizableObject &P) |
| Writes the ParametrizableObject. | |
Definition at line 23 of file MemoryManagerOptions.hpp.
| MemoryManagerOptions::MemoryManagerOptions | ( | ) | [inline, explicit] |
Definition at line 52 of file MemoryManagerOptions.hpp.
00053 { 00054 // autodoc: "sets matrix type" 00055 EnumParameter<MatrixType>* E 00056 = new EnumParameter<MatrixType>(MemoryManagerOptions::sparse, 00057 "matrix"); 00058 00059 // autodoc: "used for sparse matrices, cost is approximatly $27\times n_v\times {n_u}^2$, where $n_v$ is the number of vertices and $n_u$ the number of unknown (for a $Q_1$ discretization)" 00060 (*E).addSwitch("sparse", 00061 MemoryManagerOptions::sparse); 00062 00063 // autodoc: "do not store the matrix. Cost no memory, but is slower" 00064 (*E).addSwitch("none", 00065 MemoryManagerOptions::none); 00066 add(E); 00067 }
| std::ostream& MemoryManagerOptions::put | ( | std::ostream & | os | ) | const [inline, private, virtual] |
Implements ParametrizableObject.
Definition at line 27 of file MemoryManagerOptions.hpp.
References identifier().
00028 { 00029 os << this->identifier(); 00030 return os; 00031 }

| static const char* MemoryManagerOptions::identifier | ( | ) | [inline, static] |
| MatrixType MemoryManagerOptions::matrixType | ( | ) | [inline] |
Definition at line 45 of file MemoryManagerOptions.hpp.
References none.
Referenced by MemoryManager::ReserveMatrix().
00046 { 00047 MemoryManagerOptions::MatrixType __t = none; 00048 get("matrix", __t); 00049 return __t; 00050 }
| void ParametrizableObject::get | ( | IdentifierSet & | I | ) | [inline, inherited] |
Definition at line 54 of file ParametrizableObject.hpp.
References ParametrizableObject::__parameters.
00055 { 00056 for (ParameterList::iterator i = __parameters.begin(); 00057 i != __parameters.end(); ++i) 00058 { 00059 (*(*i).second).get(I); 00060 I.insert((*i).first); 00061 } 00062 }
| void ParametrizableObject::get | ( | const char * | label, | |
| EnumType & | e | |||
| ) | const [inline, protected, inherited] |
Definition at line 71 of file ParametrizableObject.hpp.
References Parameter::Enum.
00072 { 00073 ReferenceCounting<Parameter> p = get(label); 00074 if((*p).type() == Parameter::Enum) { 00075 e = dynamic_cast<const EnumParameter<EnumType>&>(*p); 00076 return; 00077 } 00078 }
| void ParametrizableObject::get | ( | const char * | label, | |
| real_t & | d | |||
| ) | const [inline, protected, inherited] |
Definition at line 80 of file ParametrizableObject.hpp.
References Parameter::Double.
00081 { 00082 ReferenceCounting<Parameter> p = get(label); 00083 if((*p).type() == Parameter::Double) { 00084 d = dynamic_cast<const DoubleParameter&>(*p); 00085 return; 00086 } 00087 }
| void ParametrizableObject::get | ( | const char * | label, | |
| int & | i | |||
| ) | const [inline, protected, inherited] |
Definition at line 89 of file ParametrizableObject.hpp.
References Parameter::Integer.
00090 { 00091 ReferenceCounting<Parameter> p = get(label); 00092 if((*p).type() == Parameter::Integer) { 00093 i = dynamic_cast<const IntegerParameter&>(*p); 00094 return; 00095 } 00096 }
| void ParametrizableObject::get | ( | const char * | label, | |
| std::string & | s | |||
| ) | const [inline, protected, inherited] |
Definition at line 98 of file ParametrizableObject.hpp.
References Parameter::String.
00099 { 00100 ReferenceCounting<Parameter> p = get(label); 00101 if((*p).type() == Parameter::String) { 00102 s = dynamic_cast<const StringParameter&>(*p); 00103 return; 00104 } 00105 }
| const ReferenceCounting<Parameter> ParametrizableObject::get | ( | const char * | parameterName | ) | const [inline, inherited] |
Definition at line 117 of file ParametrizableObject.hpp.
References ParametrizableObject::__parameters, ErrorHandler::normal, and stringify().
00118 { 00119 ParameterList::const_iterator i = __parameters.find(parameterName); 00120 if (i != __parameters.end()) { 00121 return (*i).second; 00122 } else { 00123 throw ErrorHandler(__FILE__,__LINE__, 00124 stringify(parameterName)+" not found", 00125 ErrorHandler::normal); 00126 return 0; 00127 } 00128 }

| void ParametrizableObject::add | ( | ReferenceCounting< Parameter > | p | ) | [inline, protected, inherited] |
Definition at line 65 of file ParametrizableObject.hpp.
References ParametrizableObject::__parameters.
00066 { 00067 __parameters[(*p).label()] = p; 00068 }
| void ParametrizableObject::reset | ( | ) | [inline, inherited] |
Definition at line 109 of file ParametrizableObject.hpp.
References ParametrizableObject::__parameters.
00110 { 00111 for (ParameterList::iterator i = __parameters.begin(); 00112 i != __parameters.end(); ++i) { 00113 (*(*i).second).reset(); 00114 } 00115 }
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const ParametrizableObject & | P | |||
| ) | [friend, inherited] |
Writes the ParametrizableObject.
Definition at line 22 of file ParametrizableObject.cpp.
00024 { 00025 os << P.put(os); 00026 return os; 00027 }
1.5.6