| 141 | } |
| 142 | |
| 143 | void PropertyInteger::setPathValue(const ObjectIdentifier& path, const boost::any& value) |
| 144 | { |
| 145 | verifyPath(path); |
| 146 | |
| 147 | if (value.type() == typeid(long)) { |
| 148 | setValue(boost::any_cast<long>(value)); |
| 149 | } |
| 150 | else if (value.type() == typeid(int)) { |
| 151 | setValue(boost::any_cast<int>(value)); |
| 152 | } |
| 153 | else if (value.type() == typeid(double)) { |
| 154 | setValue(boost::math::round(boost::any_cast<double>(value))); |
| 155 | } |
| 156 | else if (value.type() == typeid(float)) { |
| 157 | setValue(boost::math::round(boost::any_cast<float>(value))); |
| 158 | } |
| 159 | else if (value.type() == typeid(Quantity)) { |
| 160 | setValue(boost::math::round(boost::any_cast<Quantity>(value).getValue())); |
| 161 | } |
| 162 | else { |
| 163 | throw bad_cast(); |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | |
| 168 | //************************************************************************** |
nothing calls this directly
no test coverage detected