@@ -93,16 +93,10 @@ class MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type> {
9393 uint8_t * ptr, io::EpsCopyOutputStream* stream);
9494
9595 // Functions to manipulate data on memory. ========================
96- static inline const Type& GetExternalReference (const Type* value);
9796 static inline void DeleteNoArena (const Type* x);
9897 static constexpr TypeOnMemory Constinit ();
9998
10099 static inline Type* EnsureMutable (Type** value, Arena* arena);
101- // Return default instance if value is not initialized when calling const
102- // reference accessor.
103- static inline const Type& DefaultIfNotInitialized (const Type* value);
104- // Check if all required fields have values set.
105- static inline bool IsInitialized (Type* value);
106100};
107101
108102#define MAP_HANDLER (FieldType ) \
@@ -126,12 +120,7 @@ class MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type> {
126120 static inline uint8_t * Write (int field, const MapEntryAccessorType& value, \
127121 uint8_t * ptr, \
128122 io::EpsCopyOutputStream* stream); \
129- static inline const MapEntryAccessorType& GetExternalReference ( \
130- const TypeOnMemory& value); \
131123 static inline void DeleteNoArena (const TypeOnMemory& x); \
132- static inline const MapEntryAccessorType& DefaultIfNotInitialized ( \
133- const TypeOnMemory& value); \
134- static inline bool IsInitialized (const TypeOnMemory& value); \
135124 static void DeleteNoArena (TypeOnMemory& value); \
136125 static constexpr TypeOnMemory Constinit (); \
137126 static inline MapEntryAccessorType* EnsureMutable (TypeOnMemory* value, \
@@ -420,13 +409,6 @@ READ_METHOD(BOOL)
420409
421410// Definition for message handler
422411
423- template <typename Type>
424- inline const Type&
425- MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::GetExternalReference(
426- const Type* value) {
427- return *value;
428- }
429-
430412template <typename Type>
431413void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::DeleteNoArena(
432414 const Type* ptr) {
@@ -448,29 +430,9 @@ inline Type* MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::EnsureMutable(
448430 return *value;
449431}
450432
451- template <typename Type>
452- inline const Type&
453- MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::DefaultIfNotInitialized(
454- const Type* value) {
455- return value != nullptr ? *value : *Type::internal_default_instance ();
456- }
457-
458- template <typename Type>
459- inline bool MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::IsInitialized(
460- Type* value) {
461- return value ? value->IsInitialized () : false ;
462- }
463-
464433// Definition for string/bytes handler
465434
466435#define STRING_OR_BYTES_HANDLER_FUNCTIONS (FieldType ) \
467- template <typename Type> \
468- inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType, \
469- Type>::MapEntryAccessorType& \
470- MapTypeHandler<WireFormatLite::TYPE_##FieldType, \
471- Type>::GetExternalReference(const TypeOnMemory& value) { \
472- return value.Get (); \
473- } \
474436 template <typename Type> \
475437 void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::DeleteNoArena( \
476438 TypeOnMemory& value) { \
@@ -479,7 +441,7 @@ inline bool MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::IsInitialized(
479441 template <typename Type> \
480442 constexpr auto \
481443 MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Constinit() \
482- ->TypeOnMemory { \
444+ -> TypeOnMemory { \
483445 return TypeOnMemory (&internal::fixed_address_empty_string, \
484446 ConstantInitialized{}); \
485447 } \
@@ -489,32 +451,12 @@ inline bool MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::IsInitialized(
489451 MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::EnsureMutable( \
490452 TypeOnMemory* value, Arena* arena) { \
491453 return value->Mutable (arena); \
492- } \
493- template <typename Type> \
494- inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType, \
495- Type>::MapEntryAccessorType& \
496- MapTypeHandler<WireFormatLite::TYPE_##FieldType, \
497- Type>::DefaultIfNotInitialized(const TypeOnMemory& value) { \
498- return value.Get (); \
499- } \
500- template <typename Type> \
501- inline bool \
502- MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::IsInitialized( \
503- const TypeOnMemory& /* value */ ) { \
504- return true ; \
505454 }
506455STRING_OR_BYTES_HANDLER_FUNCTIONS (STRING)
507456STRING_OR_BYTES_HANDLER_FUNCTIONS (BYTES)
508457#undef STRING_OR_BYTES_HANDLER_FUNCTIONS
509458
510459#define PRIMITIVE_HANDLER_FUNCTIONS (FieldType ) \
511- template <typename Type> \
512- inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType, \
513- Type>::MapEntryAccessorType& \
514- MapTypeHandler<WireFormatLite::TYPE_##FieldType, \
515- Type>::GetExternalReference(const TypeOnMemory& value) { \
516- return value; \
517- } \
518460 template <typename Type> \
519461 inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, \
520462 Type>::DeleteNoArena(TypeOnMemory& /* x */ ) {} \
@@ -530,19 +472,6 @@ STRING_OR_BYTES_HANDLER_FUNCTIONS(BYTES)
530472 MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::EnsureMutable( \
531473 TypeOnMemory* value, Arena* /* arena */ ) { \
532474 return value; \
533- } \
534- template <typename Type> \
535- inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType, \
536- Type>::MapEntryAccessorType& \
537- MapTypeHandler<WireFormatLite::TYPE_##FieldType, \
538- Type>::DefaultIfNotInitialized(const TypeOnMemory& value) { \
539- return value; \
540- } \
541- template <typename Type> \
542- inline bool \
543- MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::IsInitialized( \
544- const TypeOnMemory& /* value */ ) { \
545- return true ; \
546475 }
547476PRIMITIVE_HANDLER_FUNCTIONS (INT64)
548477PRIMITIVE_HANDLER_FUNCTIONS (UINT64)
0 commit comments