| 454 | } |
| 455 | |
| 456 | Uuid Tuple::getUuid(size_t index) const { |
| 457 | if (index >= offsets.size()) { |
| 458 | throw invalid_tuple_index(); |
| 459 | } |
| 460 | size_t offset = offsets[index]; |
| 461 | ASSERT_LT(offset, data.size()); |
| 462 | uint8_t code = data[offset]; |
| 463 | if (code != UUID_CODE) { |
| 464 | throw invalid_tuple_data_type(); |
| 465 | } |
| 466 | ASSERT_LE(offset + Uuid::SIZE + 1, data.size()); |
| 467 | StringRef uuidData(data.begin() + offset + 1, Uuid::SIZE); |
| 468 | return Uuid(uuidData); |
| 469 | } |
| 470 | |
| 471 | Tuple Tuple::getNested(size_t index) const { |
| 472 | if (index >= offsets.size()) { |