| 1 | /* | 
|---|
| 2 | * SerializablePotentialMock.hpp | 
|---|
| 3 | * | 
|---|
| 4 | *  Created on: 23.11.2012 | 
|---|
| 5 | *      Author: heber | 
|---|
| 6 | */ | 
|---|
| 7 |  | 
|---|
| 8 | #ifndef SERIALIZABLEPOTENTIALMOCK_HPP_ | 
|---|
| 9 | #define SERIALIZABLEPOTENTIALMOCK_HPP_ | 
|---|
| 10 |  | 
|---|
| 11 | // include config.h | 
|---|
| 12 | #ifdef HAVE_CONFIG_H | 
|---|
| 13 | #include <config.h> | 
|---|
| 14 | #endif | 
|---|
| 15 |  | 
|---|
| 16 | #include <string> | 
|---|
| 17 |  | 
|---|
| 18 | #include "FunctionApproximation/FunctionModel.hpp" | 
|---|
| 19 | #include "Potentials/SerializablePotential.hpp" | 
|---|
| 20 |  | 
|---|
| 21 | /** This is a test implementation of a SerializablePotential for the unit test. | 
|---|
| 22 | * | 
|---|
| 23 | */ | 
|---|
| 24 | class SerializablePotentialMock : public SerializablePotential | 
|---|
| 25 | { | 
|---|
| 26 | public : | 
|---|
| 27 | SerializablePotentialMock() : | 
|---|
| 28 | SerializablePotential(ParticleTypes_t(1, ParticleType_t(1))), | 
|---|
| 29 | params(1, 0) | 
|---|
| 30 | {} | 
|---|
| 31 | ~SerializablePotentialMock() {} | 
|---|
| 32 |  | 
|---|
| 33 | /* ==== Implementing virtual functions from SerializablePotental ==== */ | 
|---|
| 34 |  | 
|---|
| 35 | /** Return the token name of this specific potential. | 
|---|
| 36 | * | 
|---|
| 37 | * \return token name of the potential | 
|---|
| 38 | */ | 
|---|
| 39 | const std::string& getToken() const | 
|---|
| 40 | { return potential_token; } | 
|---|
| 41 |  | 
|---|
| 42 | /** Returns a vector of parameter names. | 
|---|
| 43 | * | 
|---|
| 44 | * This is required from the specific implementation | 
|---|
| 45 | * | 
|---|
| 46 | * \return vector of strings containing parameter names | 
|---|
| 47 | */ | 
|---|
| 48 | const ParameterNames_t& getParameterNames() const | 
|---|
| 49 | { return paramNames; } | 
|---|
| 50 |  | 
|---|
| 51 | /* ==== Implementing virtual functions from FunctionModel ==== */ | 
|---|
| 52 |  | 
|---|
| 53 | /** Setter for the parameters of the model function. | 
|---|
| 54 | * | 
|---|
| 55 | * \param _params set of parameters to set | 
|---|
| 56 | */ | 
|---|
| 57 | void setParameters(const FunctionModel::parameters_t &_params); | 
|---|
| 58 |  | 
|---|
| 59 | /** Getter for the parameters of this model function. | 
|---|
| 60 | * | 
|---|
| 61 | * \return current set of parameters of the model function | 
|---|
| 62 | */ | 
|---|
| 63 | FunctionModel::parameters_t getParameters() const | 
|---|
| 64 | { return params; } | 
|---|
| 65 |  | 
|---|
| 66 | /** Getter for the number of parameters of this model function. | 
|---|
| 67 | * | 
|---|
| 68 | * \return number of parameters | 
|---|
| 69 | */ | 
|---|
| 70 | size_t getParameterDimension() const | 
|---|
| 71 | { return 1; } | 
|---|
| 72 |  | 
|---|
| 73 |  | 
|---|
| 74 | enum parameter_enum_t { | 
|---|
| 75 | dummy_constant=0, | 
|---|
| 76 | MAXPARAMS | 
|---|
| 77 | }; | 
|---|
| 78 | private: | 
|---|
| 79 | //!> parameter vector with parameters as in enum parameter_enum_t | 
|---|
| 80 | FunctionModel::parameters_t params; | 
|---|
| 81 |  | 
|---|
| 82 | private: | 
|---|
| 83 | //!> names of each parameter | 
|---|
| 84 | static const ParameterNames_t paramNames; | 
|---|
| 85 |  | 
|---|
| 86 | //!> static token of this potential type | 
|---|
| 87 | static const std::string potential_token; | 
|---|
| 88 | }; | 
|---|
| 89 |  | 
|---|
| 90 | #endif /* SERIALIZABLEPOTENTIALMOCK_HPP_ */ | 
|---|