| 395 | } |
| 396 | |
| 397 | double Tuple::getDouble(size_t index) const { |
| 398 | if (index >= offsets.size()) { |
| 399 | throw invalid_tuple_index(); |
| 400 | } |
| 401 | ASSERT_LT(offsets[index], data.size()); |
| 402 | uint8_t code = data[offsets[index]]; |
| 403 | if (code != 0x21) { |
| 404 | throw invalid_tuple_data_type(); |
| 405 | } |
| 406 | |
| 407 | double swap; |
| 408 | uint8_t* bytes = (uint8_t*)&swap; |
| 409 | ASSERT_LE(offsets[index] + 1 + sizeof(double), data.size()); |
| 410 | swap = *(double*)(data.begin() + offsets[index] + 1); |
| 411 | adjustFloatingPoint(bytes, sizeof(double), false); |
| 412 | |
| 413 | return bigEndianDouble(swap); |
| 414 | } |
| 415 | |
| 416 | Versionstamp Tuple::getVersionstamp(size_t index) const { |
| 417 | if (index >= offsets.size()) { |
no test coverage detected