OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 namespace google { | 47 namespace google { |
48 namespace protobuf { | 48 namespace protobuf { |
49 class DynamicMessage; | 49 class DynamicMessage; |
50 class MapKey; | 50 class MapKey; |
51 namespace internal { | 51 namespace internal { |
52 | 52 |
53 class ContendedMapCleanTest; | 53 class ContendedMapCleanTest; |
54 class GeneratedMessageReflection; | 54 class GeneratedMessageReflection; |
55 class MapFieldAccessor; | 55 class MapFieldAccessor; |
56 | 56 |
57 // This class provides accesss to map field using reflection, which is the same | 57 // This class provides access to map field using reflection, which is the same |
58 // as those provided for RepeatedPtrField<Message>. It is used for internal | 58 // as those provided for RepeatedPtrField<Message>. It is used for internal |
59 // reflection implentation only. Users should never use this directly. | 59 // reflection implentation only. Users should never use this directly. |
60 class LIBPROTOBUF_EXPORT MapFieldBase { | 60 class LIBPROTOBUF_EXPORT MapFieldBase { |
61 public: | 61 public: |
62 MapFieldBase() | 62 MapFieldBase() |
63 : arena_(NULL), | 63 : arena_(NULL), |
64 repeated_field_(NULL), | 64 repeated_field_(NULL), |
65 entry_descriptor_(NULL), | 65 entry_descriptor_(NULL), |
66 assign_descriptor_callback_(NULL), | 66 assign_descriptor_callback_(NULL), |
67 state_(STATE_MODIFIED_MAP) {} | 67 state_(STATE_MODIFIED_MAP) {} |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 private: | 201 private: |
202 void InitializeIterator(MapIterator* map_iter) const; | 202 void InitializeIterator(MapIterator* map_iter) const; |
203 void DeleteIterator(MapIterator* map_iter) const; | 203 void DeleteIterator(MapIterator* map_iter) const; |
204 void CopyIterator(MapIterator* this_iteratorm, | 204 void CopyIterator(MapIterator* this_iteratorm, |
205 const MapIterator& that_iterator) const; | 205 const MapIterator& that_iterator) const; |
206 void IncreaseIterator(MapIterator* map_iter) const; | 206 void IncreaseIterator(MapIterator* map_iter) const; |
207 | 207 |
208 virtual void SetMapIteratorValue(MapIterator* map_iter) const = 0; | 208 virtual void SetMapIteratorValue(MapIterator* map_iter) const = 0; |
209 }; | 209 }; |
210 | 210 |
211 // This class provides accesss to map field using generated api. It is used for | 211 // This class provides access to map field using generated api. It is used for |
212 // internal generated message implentation only. Users should never use this | 212 // internal generated message implentation only. Users should never use this |
213 // directly. | 213 // directly. |
214 template <typename Key, typename T, | 214 template <typename Key, typename T, |
215 WireFormatLite::FieldType kKeyFieldType, | 215 WireFormatLite::FieldType kKeyFieldType, |
216 WireFormatLite::FieldType kValueFieldType, | 216 WireFormatLite::FieldType kValueFieldType, |
217 int default_enum_value = 0> | 217 int default_enum_value = 0> |
218 class MapField : public TypeDefinedMapFieldBase<Key, T>, | 218 class MapField : public TypeDefinedMapFieldBase<Key, T>, |
219 public MapFieldLite<Key, T, kKeyFieldType, kValueFieldType, | 219 public MapFieldLite<Key, T, kKeyFieldType, kValueFieldType, |
220 default_enum_value> { | 220 default_enum_value> { |
221 // Provide utilities to parse/serialize key/value. Provide utilities to | 221 // Provide utilities to parse/serialize key/value. Provide utilities to |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 // MapIterator does not own this object. | 388 // MapIterator does not own this object. |
389 internal::MapFieldBase* map_; | 389 internal::MapFieldBase* map_; |
390 MapKey key_; | 390 MapKey key_; |
391 MapValueRef value_; | 391 MapValueRef value_; |
392 }; | 392 }; |
393 | 393 |
394 } // namespace protobuf | 394 } // namespace protobuf |
395 | 395 |
396 } // namespace google | 396 } // namespace google |
397 #endif // GOOGLE_PROTOBUF_MAP_FIELD_H__ | 397 #endif // GOOGLE_PROTOBUF_MAP_FIELD_H__ |
OLD | NEW |