MCPcopy Create free account
hub / github.com/apple/foundationdb / getDouble

Method getDouble

bindings/flow/Tuple.cpp:424–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424double 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
443Versionstamp Tuple::getVersionstamp(size_t index) const {
444 if (index >= offsets.size()) {

Callers 4

tupleToStringFunction · 0.45
callMethod · 0.45
callMethod · 0.45
callMethod · 0.45

Calls 4

adjust_floating_pointFunction · 0.85
bigEndianDoubleFunction · 0.70
sizeMethod · 0.45
beginMethod · 0.45

Tested by 4

tupleToStringFunction · 0.36
callMethod · 0.36
callMethod · 0.36
callMethod · 0.36