| 53 | |
| 54 | template <typename T> |
| 55 | bool SetValue(const std::string& name, const T& value) { |
| 56 | if (name_to_param_.count(name) == 0) { |
| 57 | return false; |
| 58 | } |
| 59 | |
| 60 | auto& param_item = name_to_param_[name]; |
| 61 | switch (param_item.type) { |
| 62 | case kInt32Param: |
| 63 | *(reinterpret_cast<int32_t*>(param_item.target)) = |
| 64 | static_cast<int32_t>(value); |
| 65 | break; |
| 66 | case kFloatParam: |
| 67 | *(reinterpret_cast<float*>(param_item.target)) = |
| 68 | static_cast<float>(value); |
| 69 | break; |
| 70 | default: |
| 71 | return false; |
| 72 | } |
| 73 | |
| 74 | return true; |
| 75 | } |
| 76 | |
| 77 | virtual void DisplayAllParams() {} |
| 78 |
no outgoing calls
no test coverage detected