39 #ifndef GOOGLE_PROTOBUF_MESSAGE_LITE_H__
40 #define GOOGLE_PROTOBUF_MESSAGE_LITE_H__
45 #include <google/protobuf/stubs/common.h>
46 #include <google/protobuf/stubs/logging.h>
47 #include <google/protobuf/io/coded_stream.h>
48 #include <google/protobuf/arena.h>
50 #include <google/protobuf/metadata_lite.h>
51 #include <google/protobuf/stubs/once.h>
52 #include <google/protobuf/port.h>
53 #include <google/protobuf/stubs/strutil.h>
57 #include <google/protobuf/port_def.inc>
61 #error "You cannot SWIG proto headers"
68 class RepeatedPtrField;
70 class FastReflectionMessageMutator;
71 class FastReflectionStringSetter;
84 class SwapFieldHelper;
102 template <
typename Type>
121 return static_cast<unsigned int>(
size);
129 return static_cast<int>(
size);
134 PROTOBUF_EXPORT
extern ExplicitlyConstructed<std::string>
198 virtual void Clear() = 0;
206 virtual std::string InitializationErrorString()
const;
210 virtual void CheckTypeAndMergeFrom(
const MessageLite& other) = 0;
237 PROTOBUF_ATTRIBUTE_REINITIALIZES
bool ParseFromCodedStream(
241 PROTOBUF_ATTRIBUTE_REINITIALIZES
bool ParsePartialFromCodedStream(
245 PROTOBUF_ATTRIBUTE_REINITIALIZES
bool ParseFromZeroCopyStream(
249 PROTOBUF_ATTRIBUTE_REINITIALIZES
bool ParsePartialFromZeroCopyStream(
253 PROTOBUF_ATTRIBUTE_REINITIALIZES
bool ParseFromFileDescriptor(
254 int file_descriptor);
257 PROTOBUF_ATTRIBUTE_REINITIALIZES
bool ParsePartialFromFileDescriptor(
258 int file_descriptor);
261 PROTOBUF_ATTRIBUTE_REINITIALIZES
bool ParseFromIstream(std::istream*
input);
264 PROTOBUF_ATTRIBUTE_REINITIALIZES
bool ParsePartialFromIstream(
265 std::istream*
input);
274 PROTOBUF_ATTRIBUTE_REINITIALIZES
bool ParseFromBoundedZeroCopyStream(
278 PROTOBUF_ATTRIBUTE_REINITIALIZES
bool ParsePartialFromBoundedZeroCopyStream(
288 PROTOBUF_ATTRIBUTE_REINITIALIZES
bool ParsePartialFromString(
291 PROTOBUF_ATTRIBUTE_REINITIALIZES
bool ParseFromArray(
const void*
data,
295 PROTOBUF_ATTRIBUTE_REINITIALIZES
bool ParsePartialFromArray(
const void*
data,
345 bool SerializeToArray(
void*
data,
int size)
const;
347 bool SerializePartialToArray(
void*
data,
int size)
const;
361 bool SerializeToFileDescriptor(
int file_descriptor)
const;
363 bool SerializePartialToFileDescriptor(
int file_descriptor)
const;
366 bool SerializeToOstream(std::ostream*
output)
const;
368 bool SerializePartialToOstream(std::ostream*
output)
const;
382 virtual size_t ByteSizeLong()
const = 0;
385 PROTOBUF_DEPRECATED_MSG(
"Please use ByteSizeLong() instead")
418 virtual int GetCachedSize()
const = 0;
426 template <
typename T>
428 return Arena::CreateMaybeMessage<T>(
arena);
432 : _internal_metadata_(
arena, is_message_owned) {}
453 kMergeWithAliasing = 4,
454 kParseWithAliasing = 5,
455 kMergePartialWithAliasing = 6,
456 kParsePartialWithAliasing = 7
459 template <ParseFlags flags,
typename T>
460 bool ParseFrom(
const T&
input);
470 LogInitializationErrorMessage();
478 friend class FastReflectionMessageMutator;
479 friend class FastReflectionStringSetter;
483 friend class internal::LazyField;
486 friend class internal::WeakFieldMap;
489 template <
typename Type>
490 friend class Arena::InternalHelper;
491 template <
typename Type>
494 void LogInitializationErrorMessage()
const;
503 template <
bool alias>
513 template <
bool alias>
528 template <
bool alias>
536 template <
typename T>
537 struct SourceWrapper;
539 template <
bool alias,
typename T>
542 return input.template MergeInto<alias>(
msg, parse_flags);
547 template <MessageLite::ParseFlags flags,
typename T>
551 return internal::MergeFromImpl<alias>(
input,
this,
flags);
579 PROTOBUF_EXPORT
void OnShutdownRun(
void (*f)(
const void*),
const void*
arg);
581 template <
typename T>
591 #include <google/protobuf/port_undef.inc>
593 #endif // GOOGLE_PROTOBUF_MESSAGE_LITE_H__