You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

inlined_string_field.h 22 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. // Protocol Buffers - Google's data interchange format
  2. // Copyright 2008 Google Inc. All rights reserved.
  3. // https://developers.google.com/protocol-buffers/
  4. //
  5. // Redistribution and use in source and binary forms, with or without
  6. // modification, are permitted provided that the following conditions are
  7. // met:
  8. //
  9. // * Redistributions of source code must retain the above copyright
  10. // notice, this list of conditions and the following disclaimer.
  11. // * Redistributions in binary form must reproduce the above
  12. // copyright notice, this list of conditions and the following disclaimer
  13. // in the documentation and/or other materials provided with the
  14. // distribution.
  15. // * Neither the name of Google Inc. nor the names of its
  16. // contributors may be used to endorse or promote products derived from
  17. // this software without specific prior written permission.
  18. //
  19. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  22. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  23. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  24. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  25. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  26. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  27. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  28. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. #ifndef GOOGLE_PROTOBUF_INLINED_STRING_FIELD_H__
  31. #define GOOGLE_PROTOBUF_INLINED_STRING_FIELD_H__
  32. #include <string>
  33. #include <utility>
  34. #include <google/protobuf/stubs/logging.h>
  35. #include <google/protobuf/stubs/common.h>
  36. #include <google/protobuf/port.h>
  37. #include <google/protobuf/stubs/strutil.h>
  38. #include <google/protobuf/arenastring.h>
  39. #include <google/protobuf/message_lite.h>
  40. // Must be included last.
  41. #include <google/protobuf/port_def.inc>
  42. #ifdef SWIG
  43. #error "You cannot SWIG proto headers"
  44. #endif
  45. namespace google {
  46. namespace protobuf {
  47. class Arena;
  48. namespace internal {
  49. // InlinedStringField wraps a std::string instance and exposes an API similar to
  50. // ArenaStringPtr's wrapping of a std::string* instance.
  51. //
  52. // default_value parameters are taken for consistency with ArenaStringPtr, but
  53. // are not used for most methods. With inlining, these should be removed from
  54. // the generated binary.
  55. //
  56. // InlinedStringField has a donating mechanism that allows string buffer
  57. // allocated on arena. A string is donated means both the string container and
  58. // the data buffer are on arena. The donating mechanism here is similar to the
  59. // one in ArenaStringPtr with some differences:
  60. //
  61. // When an InlinedStringField is constructed, the donating state is true. This
  62. // is because the string container is directly stored in the message on the
  63. // arena:
  64. //
  65. // Construction: donated=true
  66. // Arena:
  67. // +-----------------------+
  68. // |Message foo: |
  69. // | +-------------------+ |
  70. // | |InlinedStringField:| |
  71. // | | +-----+ | |
  72. // | | | | | | | |
  73. // | | +-----+ | |
  74. // | +-------------------+ |
  75. // +-----------------------+
  76. //
  77. // When lvalue Set is called, the donating state is still true. String data will
  78. // be allocated on the arena:
  79. //
  80. // Lvalue Set: donated=true
  81. // Arena:
  82. // +-----------------------+
  83. // |Message foo: |
  84. // | +-------------------+ |
  85. // | |InlinedStringField:| |
  86. // | | +-----+ | |
  87. // | | | | | | | |
  88. // | | +|----+ | |
  89. // | +--|----------------+ |
  90. // | V |
  91. // | +----------------+ |
  92. // | |'f','o','o',... | |
  93. // | +----------------+ |
  94. // +-----------------------+
  95. //
  96. // Some operations will undonate a donated string, including: Mutable,
  97. // SetAllocated, Rvalue Set, and Swap with a non-donated string.
  98. //
  99. // For more details of the donating states transitions, go/pd-inlined-string.
  100. class PROTOBUF_EXPORT InlinedStringField {
  101. public:
  102. InlinedStringField() { Init(); }
  103. inline void Init() { new (get_mutable()) std::string(); }
  104. // Add the dummy parameter just to make InlinedStringField(nullptr)
  105. // unambiguous.
  106. constexpr InlinedStringField(
  107. const ExplicitlyConstructed<std::string>* /*default_value*/,
  108. bool /*dummy*/)
  109. : value_{} {}
  110. explicit InlinedStringField(const std::string& default_value);
  111. explicit InlinedStringField(Arena* arena);
  112. ~InlinedStringField() { Destruct(); }
  113. // Lvalue Set. To save space, we pack the donating states of multiple
  114. // InlinedStringFields into an uint32_t `donating_states`. The `mask`
  115. // indicates the position of the bit for this InlinedStringField. `donated` is
  116. // whether this field is donated.
  117. //
  118. // The caller should guarantee that:
  119. //
  120. // `donated == ((donating_states & ~mask) != 0)`
  121. //
  122. // This method never changes the `donating_states`.
  123. void Set(ConstStringParam value, Arena* arena, bool donated,
  124. uint32_t* donating_states, uint32_t mask, MessageLite* msg);
  125. // Rvalue Set. If this field is donated, this method will undonate this field
  126. // by mutating the `donating_states` according to `mask`.
  127. void Set(std::string&& value, Arena* arena, bool donated,
  128. uint32_t* donating_states, uint32_t mask, MessageLite* msg);
  129. void Set(const char* str, ::google::protobuf::Arena* arena, bool donated,
  130. uint32_t* donating_states, uint32_t mask, MessageLite* msg);
  131. void Set(const char* str, size_t size, ::google::protobuf::Arena* arena, bool donated,
  132. uint32_t* donating_states, uint32_t mask, MessageLite* msg);
  133. template <typename RefWrappedType>
  134. void Set(std::reference_wrapper<RefWrappedType> const_string_ref,
  135. ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states,
  136. uint32_t mask, MessageLite* msg);
  137. void SetBytes(ConstStringParam value, Arena* arena, bool donated,
  138. uint32_t* donating_states, uint32_t mask, MessageLite* msg);
  139. void SetBytes(std::string&& value, Arena* arena, bool donated,
  140. uint32_t* donating_states, uint32_t mask, MessageLite* msg);
  141. void SetBytes(const char* str, ::google::protobuf::Arena* arena, bool donated,
  142. uint32_t* donating_states, uint32_t mask, MessageLite* msg);
  143. void SetBytes(const void* p, size_t size, ::google::protobuf::Arena* arena,
  144. bool donated, uint32_t* donating_states, uint32_t mask,
  145. MessageLite* msg);
  146. template <typename RefWrappedType>
  147. void SetBytes(std::reference_wrapper<RefWrappedType> const_string_ref,
  148. ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states,
  149. uint32_t mask, MessageLite* msg);
  150. PROTOBUF_NDEBUG_INLINE void SetNoArena(StringPiece value);
  151. PROTOBUF_NDEBUG_INLINE void SetNoArena(std::string&& value);
  152. // Basic accessors.
  153. PROTOBUF_NDEBUG_INLINE const std::string& Get() const { return GetNoArena(); }
  154. PROTOBUF_NDEBUG_INLINE const std::string& GetNoArena() const;
  155. // Mutable returns a std::string* instance that is heap-allocated. If this
  156. // field is donated, this method undonates this field by mutating the
  157. // `donating_states` according to `mask`, and copies the content of the
  158. // original string to the returning string.
  159. std::string* Mutable(Arena* arena, bool donated, uint32_t* donating_states,
  160. uint32_t mask, MessageLite* msg);
  161. std::string* Mutable(const LazyString& default_value, Arena* arena,
  162. bool donated, uint32_t* donating_states, uint32_t mask,
  163. MessageLite* msg);
  164. // Mutable(nullptr_t) is an overload to explicitly support Mutable(nullptr)
  165. // calls used by the internal parser logic. This provides API equivalence with
  166. // ArenaStringPtr, while still protecting against calls with arena pointers.
  167. std::string* Mutable(std::nullptr_t);
  168. std::string* MutableNoCopy(std::nullptr_t);
  169. // Takes a std::string that is heap-allocated, and takes ownership. The
  170. // std::string's destructor is registered with the arena. Used to implement
  171. // set_allocated_<field> in generated classes.
  172. //
  173. // If this field is donated, this method undonates this field by mutating the
  174. // `donating_states` according to `mask`.
  175. void SetAllocated(const std::string* default_value, std::string* value,
  176. Arena* arena, bool donated, uint32_t* donating_states,
  177. uint32_t mask, MessageLite* msg);
  178. void SetAllocatedNoArena(const std::string* default_value,
  179. std::string* value);
  180. // Release returns a std::string* instance that is heap-allocated and is not
  181. // Own()'d by any arena. If the field is not set, this returns nullptr. The
  182. // caller retains ownership. Clears this field back to nullptr state. Used to
  183. // implement release_<field>() methods on generated classes.
  184. PROTOBUF_NODISCARD std::string* Release(Arena* arena, bool donated);
  185. PROTOBUF_NODISCARD std::string* Release();
  186. // --------------------------------------------------------
  187. // Below functions will be removed in subsequent code change
  188. // --------------------------------------------------------
  189. #ifdef DEPRECATED_METHODS_TO_BE_DELETED
  190. PROTOBUF_NODISCARD std::string* Release(const std::string*, Arena* arena,
  191. bool donated) {
  192. return Release(arena, donated);
  193. }
  194. PROTOBUF_NODISCARD std::string* ReleaseNonDefault(const std::string*,
  195. Arena* arena) {
  196. return Release();
  197. }
  198. std::string* ReleaseNonDefaultNoArena(const std::string* default_value) {
  199. return Release();
  200. }
  201. void Set(const std::string*, ConstStringParam value, Arena* arena,
  202. bool donated, uint32_t* donating_states, uint32_t mask,
  203. MessageLite* msg) {
  204. Set(value, arena, donated, donating_states, mask, msg);
  205. }
  206. void Set(const std::string*, std::string&& value, Arena* arena, bool donated,
  207. uint32_t* donating_states, uint32_t mask, MessageLite* msg) {
  208. Set(std::move(value), arena, donated, donating_states, mask, msg);
  209. }
  210. template <typename FirstParam>
  211. void Set(FirstParam, const char* str, ::google::protobuf::Arena* arena, bool donated,
  212. uint32_t* donating_states, uint32_t mask, MessageLite* msg) {
  213. Set(str, arena, donated, donating_states, mask, msg);
  214. }
  215. template <typename FirstParam>
  216. void Set(FirstParam p1, const char* str, size_t size, ::google::protobuf::Arena* arena,
  217. bool donated, uint32_t* donating_states, uint32_t mask,
  218. MessageLite* msg) {
  219. Set(str, size, arena, donated, donating_states, mask, msg);
  220. }
  221. template <typename FirstParam, typename RefWrappedType>
  222. void Set(FirstParam p1,
  223. std::reference_wrapper<RefWrappedType> const_string_ref,
  224. ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states,
  225. uint32_t mask, MessageLite* msg) {
  226. Set(const_string_ref, arena, donated, donating_states, mask, msg);
  227. }
  228. void SetBytes(const std::string*, ConstStringParam value, Arena* arena,
  229. bool donated, uint32_t* donating_states, uint32_t mask,
  230. MessageLite* msg) {
  231. Set(value, arena, donated, donating_states, mask, msg);
  232. }
  233. void SetBytes(const std::string*, std::string&& value, Arena* arena,
  234. bool donated, uint32_t* donating_states, uint32_t mask,
  235. MessageLite* msg) {
  236. Set(std::move(value), arena, donated, donating_states, mask, msg);
  237. }
  238. template <typename FirstParam>
  239. void SetBytes(FirstParam p1, const char* str, ::google::protobuf::Arena* arena,
  240. bool donated, uint32_t* donating_states, uint32_t mask,
  241. MessageLite* msg) {
  242. SetBytes(str, arena, donated, donating_states, mask, msg);
  243. }
  244. template <typename FirstParam>
  245. void SetBytes(FirstParam p1, const void* p, size_t size,
  246. ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states,
  247. uint32_t mask, MessageLite* msg) {
  248. SetBytes(p, size, arena, donated, donating_states, mask, msg);
  249. }
  250. template <typename FirstParam, typename RefWrappedType>
  251. void SetBytes(FirstParam p1,
  252. std::reference_wrapper<RefWrappedType> const_string_ref,
  253. ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states,
  254. uint32_t mask, MessageLite* msg) {
  255. SetBytes(const_string_ref.get(), arena, donated, donating_states, mask,
  256. msg);
  257. }
  258. void SetNoArena(const std::string*, StringPiece value) {
  259. SetNoArena(value);
  260. }
  261. void SetNoArena(const std::string*, std::string&& value) {
  262. SetNoArena(std::move(value));
  263. }
  264. std::string* Mutable(ArenaStringPtr::EmptyDefault, Arena* arena, bool donated,
  265. uint32_t* donating_states, uint32_t mask,
  266. MessageLite* msg) {
  267. return Mutable(arena, donated, donating_states, mask, msg);
  268. }
  269. PROTOBUF_NDEBUG_INLINE std::string* MutableNoArenaNoDefault(
  270. const std::string* /*default_value*/) {
  271. return MutableNoCopy(nullptr);
  272. }
  273. #endif // DEPRECATED_METHODS_TO_BE_DELETED
  274. // Arena-safety semantics: this is guarded by the logic in
  275. // Swap()/UnsafeArenaSwap() at the message level, so this method is
  276. // 'unsafe' if called directly.
  277. inline PROTOBUF_NDEBUG_INLINE static void InternalSwap(
  278. InlinedStringField* lhs, Arena* lhs_arena, bool lhs_arena_dtor_registered,
  279. MessageLite* lhs_msg, //
  280. InlinedStringField* rhs, Arena* rhs_arena, bool rhs_arena_dtor_registered,
  281. MessageLite* rhs_msg);
  282. // Frees storage (if not on an arena).
  283. PROTOBUF_NDEBUG_INLINE void Destroy(const std::string* default_value,
  284. Arena* arena) {
  285. if (arena == nullptr) {
  286. DestroyNoArena(default_value);
  287. }
  288. }
  289. PROTOBUF_NDEBUG_INLINE void DestroyNoArena(const std::string* default_value);
  290. // Clears content, but keeps allocated std::string, to avoid the overhead of
  291. // heap operations. After this returns, the content (as seen by the user) will
  292. // always be the empty std::string.
  293. PROTOBUF_NDEBUG_INLINE void ClearToEmpty() { ClearNonDefaultToEmpty(); }
  294. PROTOBUF_NDEBUG_INLINE void ClearNonDefaultToEmpty() {
  295. get_mutable()->clear();
  296. }
  297. // Clears content, but keeps allocated std::string if arena != nullptr, to
  298. // avoid the overhead of heap operations. After this returns, the content (as
  299. // seen by the user) will always be equal to |default_value|.
  300. void ClearToDefault(const LazyString& default_value, Arena* arena,
  301. bool donated);
  302. // Generated code / reflection only! Returns a mutable pointer to the string.
  303. PROTOBUF_NDEBUG_INLINE std::string* UnsafeMutablePointer();
  304. // InlinedStringField doesn't have things like the `default_value` pointer in
  305. // ArenaStringPtr.
  306. static constexpr bool IsDefault() { return false; }
  307. static constexpr bool IsDefault(const std::string*) { return false; }
  308. private:
  309. void Destruct() { get_mutable()->~basic_string(); }
  310. PROTOBUF_NDEBUG_INLINE std::string* get_mutable();
  311. PROTOBUF_NDEBUG_INLINE const std::string* get_const() const;
  312. alignas(std::string) char value_[sizeof(std::string)];
  313. std::string* MutableSlow(::google::protobuf::Arena* arena, bool donated,
  314. uint32_t* donating_states, uint32_t mask,
  315. MessageLite* msg);
  316. // When constructed in an Arena, we want our destructor to be skipped.
  317. friend class ::google::protobuf::Arena;
  318. typedef void InternalArenaConstructable_;
  319. typedef void DestructorSkippable_;
  320. };
  321. inline std::string* InlinedStringField::get_mutable() {
  322. return reinterpret_cast<std::string*>(&value_);
  323. }
  324. inline const std::string* InlinedStringField::get_const() const {
  325. return reinterpret_cast<const std::string*>(&value_);
  326. }
  327. inline InlinedStringField::InlinedStringField(
  328. const std::string& default_value) {
  329. new (get_mutable()) std::string(default_value);
  330. }
  331. inline InlinedStringField::InlinedStringField(Arena* /*arena*/) { Init(); }
  332. inline const std::string& InlinedStringField::GetNoArena() const {
  333. return *get_const();
  334. }
  335. inline void InlinedStringField::SetAllocatedNoArena(
  336. const std::string* /*default_value*/, std::string* value) {
  337. if (value == nullptr) {
  338. // Currently, inlined string field can't have non empty default.
  339. get_mutable()->clear();
  340. } else {
  341. get_mutable()->assign(std::move(*value));
  342. delete value;
  343. }
  344. }
  345. inline void InlinedStringField::DestroyNoArena(const std::string*) {
  346. // This is invoked from the generated message's ArenaDtor, which is used to
  347. // clean up objects not allocated on the Arena.
  348. this->~InlinedStringField();
  349. }
  350. inline void InlinedStringField::SetNoArena(StringPiece value) {
  351. get_mutable()->assign(value.data(), value.length());
  352. }
  353. inline void InlinedStringField::SetNoArena(std::string&& value) {
  354. get_mutable()->assign(std::move(value));
  355. }
  356. // Caller should make sure rhs_arena allocated rhs, and lhs_arena allocated lhs.
  357. inline PROTOBUF_NDEBUG_INLINE void InlinedStringField::InternalSwap(
  358. InlinedStringField* lhs, Arena* lhs_arena, bool lhs_arena_dtor_registered,
  359. MessageLite* lhs_msg, //
  360. InlinedStringField* rhs, Arena* rhs_arena, bool rhs_arena_dtor_registered,
  361. MessageLite* rhs_msg) {
  362. #if GOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE
  363. lhs->get_mutable()->swap(*rhs->get_mutable());
  364. if (!lhs_arena_dtor_registered && rhs_arena_dtor_registered) {
  365. lhs_msg->OnDemandRegisterArenaDtor(lhs_arena);
  366. } else if (lhs_arena_dtor_registered && !rhs_arena_dtor_registered) {
  367. rhs_msg->OnDemandRegisterArenaDtor(rhs_arena);
  368. }
  369. #else
  370. (void)lhs_arena;
  371. (void)rhs_arena;
  372. (void)lhs_arena_dtor_registered;
  373. (void)rhs_arena_dtor_registered;
  374. (void)lhs_msg;
  375. (void)rhs_msg;
  376. lhs->get_mutable()->swap(*rhs->get_mutable());
  377. #endif
  378. }
  379. inline void InlinedStringField::Set(ConstStringParam value, Arena* arena,
  380. bool donated, uint32_t* /*donating_states*/,
  381. uint32_t /*mask*/, MessageLite* /*msg*/) {
  382. (void)arena;
  383. (void)donated;
  384. SetNoArena(value);
  385. }
  386. inline void InlinedStringField::Set(const char* str, ::google::protobuf::Arena* arena,
  387. bool donated, uint32_t* donating_states,
  388. uint32_t mask, MessageLite* msg) {
  389. Set(ConstStringParam(str), arena, donated, donating_states, mask, msg);
  390. }
  391. inline void InlinedStringField::Set(const char* str, size_t size,
  392. ::google::protobuf::Arena* arena, bool donated,
  393. uint32_t* donating_states, uint32_t mask,
  394. MessageLite* msg) {
  395. Set(ConstStringParam{str, size}, arena, donated, donating_states, mask, msg);
  396. }
  397. inline void InlinedStringField::SetBytes(ConstStringParam value, Arena* arena,
  398. bool donated,
  399. uint32_t* donating_states,
  400. uint32_t mask, MessageLite* msg) {
  401. Set(value, arena, donated, donating_states, mask, msg);
  402. }
  403. inline void InlinedStringField::SetBytes(std::string&& value, Arena* arena,
  404. bool donated,
  405. uint32_t* donating_states,
  406. uint32_t mask, MessageLite* msg) {
  407. Set(std::move(value), arena, donated, donating_states, mask, msg);
  408. }
  409. inline void InlinedStringField::SetBytes(const char* str,
  410. ::google::protobuf::Arena* arena, bool donated,
  411. uint32_t* donating_states,
  412. uint32_t mask, MessageLite* msg) {
  413. Set(str, arena, donated, donating_states, mask, msg);
  414. }
  415. inline void InlinedStringField::SetBytes(const void* p, size_t size,
  416. ::google::protobuf::Arena* arena, bool donated,
  417. uint32_t* donating_states,
  418. uint32_t mask, MessageLite* msg) {
  419. Set(static_cast<const char*>(p), size, arena, donated, donating_states, mask,
  420. msg);
  421. }
  422. template <typename RefWrappedType>
  423. inline void InlinedStringField::Set(
  424. std::reference_wrapper<RefWrappedType> const_string_ref,
  425. ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states,
  426. uint32_t mask, MessageLite* msg) {
  427. Set(const_string_ref.get(), arena, donated, donating_states, mask, msg);
  428. }
  429. template <typename RefWrappedType>
  430. inline void InlinedStringField::SetBytes(
  431. std::reference_wrapper<RefWrappedType> const_string_ref,
  432. ::google::protobuf::Arena* arena, bool donated, uint32_t* donating_states,
  433. uint32_t mask, MessageLite* msg) {
  434. Set(const_string_ref.get(), arena, donated, donating_states, mask, msg);
  435. }
  436. inline std::string* InlinedStringField::UnsafeMutablePointer() {
  437. return get_mutable();
  438. }
  439. inline std::string* InlinedStringField::Mutable(std::nullptr_t) {
  440. return get_mutable();
  441. }
  442. inline std::string* InlinedStringField::MutableNoCopy(std::nullptr_t) {
  443. return get_mutable();
  444. }
  445. } // namespace internal
  446. } // namespace protobuf
  447. } // namespace google
  448. #include <google/protobuf/port_undef.inc>
  449. #endif // GOOGLE_PROTOBUF_INLINED_STRING_FIELD_H__