| 602 | } |
| 603 | |
| 604 | double Field::getDouble() const { |
| 605 | switch (_type) { |
| 606 | case InternalType::Varint: |
| 607 | return WireFormat::DecodeDouble(_data.varint); |
| 608 | case InternalType::Fixed64: |
| 609 | return WireFormat::DecodeDouble(_data.fixed64); |
| 610 | case InternalType::Fixed32: |
| 611 | return static_cast<double>(WireFormat::DecodeFloat(_data.fixed32)); |
| 612 | case InternalType::Unset: |
| 613 | case InternalType::Raw: |
| 614 | case InternalType::Ref: |
| 615 | return 0; |
| 616 | } |
| 617 | } |
| 618 | |
| 619 | void Field::setDouble(double v) { |
| 620 | setFixed64(WireFormat::EncodeDouble(v)); |
no outgoing calls