diff options
Diffstat (limited to 'src/google/protobuf/dynamic_message.h')
-rw-r--r-- | src/google/protobuf/dynamic_message.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/google/protobuf/dynamic_message.h b/src/google/protobuf/dynamic_message.h index 81dd2c6..10ed700 100644 --- a/src/google/protobuf/dynamic_message.h +++ b/src/google/protobuf/dynamic_message.h @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -38,6 +38,8 @@ #ifndef GOOGLE_PROTOBUF_DYNAMIC_MESSAGE_H__ #define GOOGLE_PROTOBUF_DYNAMIC_MESSAGE_H__ +#include <memory> + #include <google/protobuf/message.h> #include <google/protobuf/stubs/common.h> @@ -68,7 +70,7 @@ class DescriptorPool; // descriptor.h class LIBPROTOBUF_EXPORT DynamicMessageFactory : public MessageFactory { public: // Construct a DynamicMessageFactory that will search for extensions in - // the DescriptorPool in which the exendee is defined. + // the DescriptorPool in which the extendee is defined. DynamicMessageFactory(); // Construct a DynamicMessageFactory that will search for extensions in @@ -102,7 +104,7 @@ class LIBPROTOBUF_EXPORT DynamicMessageFactory : public MessageFactory { // object. The returned object remains property of the factory and will // be destroyed when the factory is destroyed. Also, any objects created // by calling the prototype's New() method share some data with the - // prototype, so these must be destoyed before the DynamicMessageFactory + // prototype, so these must be destroyed before the DynamicMessageFactory // is destroyed. // // The given descriptor must outlive the returned message, and hence must @@ -127,6 +129,16 @@ class LIBPROTOBUF_EXPORT DynamicMessageFactory : public MessageFactory { friend class DynamicMessage; const Message* GetPrototypeNoLock(const Descriptor* type); + // Construct default oneof instance for reflection usage if oneof + // is defined. + static void ConstructDefaultOneofInstance(const Descriptor* type, + const int offsets[], + void* default_oneof_instance); + // Delete default oneof instance. Called by ~DynamicMessageFactory. + static void DeleteDefaultOneofInstance(const Descriptor* type, + const int offsets[], + void* default_oneof_instance); + GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DynamicMessageFactory); }; |