diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2017-07-18 15:38:30 -0700 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2017-07-18 15:38:30 -0700 |
commit | 09354db1434859a31a3c81abebcc4018d42f2715 (patch) | |
tree | b87c7cdc2255e6c8062ab92b4082665cd698d753 /src/google/protobuf/map_entry.h | |
parent | 9053033a5076f82cf18b823c31f352e95e5bfd8d (diff) |
Merge from Google internal for 3.4 release
Diffstat (limited to 'src/google/protobuf/map_entry.h')
-rw-r--r-- | src/google/protobuf/map_entry.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/google/protobuf/map_entry.h b/src/google/protobuf/map_entry.h index 7c675568..7c618b82 100644 --- a/src/google/protobuf/map_entry.h +++ b/src/google/protobuf/map_entry.h @@ -98,8 +98,7 @@ class MapEntry offsets_, has_bits_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapEntry, _has_bits_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapEntry, - _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapEntry, _internal_metadata_), -1, -1, sizeof(MapEntry)}; @@ -147,6 +146,30 @@ template <typename Derived, typename Key, typename Value, uint32 MapEntry<Derived, Key, Value, kKeyFieldType, kValueFieldType, default_enum_value>::has_bits_[2] = {0, 1}; +// Specialization for the full runtime +template <typename Derived, typename Key, typename Value, + WireFormatLite::FieldType kKeyFieldType, + WireFormatLite::FieldType kValueFieldType, int default_enum_value> +struct MapEntryHelper<MapEntry<Derived, Key, Value, kKeyFieldType, + kValueFieldType, default_enum_value> > + : MapEntryHelper<MapEntryLite<Key, Value, kKeyFieldType, kValueFieldType, + default_enum_value> > { + explicit MapEntryHelper(const MapPair<Key, Value>& map_pair) + : MapEntryHelper<MapEntryLite<Key, Value, kKeyFieldType, kValueFieldType, + default_enum_value> >(map_pair) {} +}; + +template <typename Derived, typename K, typename V, + WireFormatLite::FieldType key, WireFormatLite::FieldType value, + int default_enum> +struct DeconstructMapEntry<MapEntry<Derived, K, V, key, value, default_enum> > { + typedef K Key; + typedef V Value; + static const WireFormatLite::FieldType kKeyFieldType = key; + static const WireFormatLite::FieldType kValueFieldType = value; + static const int default_enum_value = default_enum; +}; + } // namespace internal } // namespace protobuf |