| 422 | } |
| 423 | |
| 424 | double Tuple::getDouble(size_t index) const { |
| 425 | if (index >= offsets.size()) { |
| 426 | throw invalid_tuple_index(); |
| 427 | } |
| 428 | ASSERT_LT(offsets[index], data.size()); |
| 429 | uint8_t code = data[offsets[index]]; |
| 430 | if (code != DOUBLE_CODE) { |
| 431 | throw invalid_tuple_data_type(); |
| 432 | } |
| 433 | |
| 434 | double swap; |
| 435 | uint8_t* bytes = (uint8_t*)&swap; |
| 436 | ASSERT_LE(offsets[index] + 1 + sizeof(double), data.size()); |
| 437 | swap = *(double*)(data.begin() + offsets[index] + 1); |
| 438 | adjust_floating_point(bytes, sizeof(double), false); |
| 439 | |
| 440 | return bigEndianDouble(swap); |
| 441 | } |
| 442 | |
| 443 | Versionstamp Tuple::getVersionstamp(size_t index) const { |
| 444 | if (index >= offsets.size()) { |