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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 // implements FieldGenerator --------------------------------------- | 53 // implements FieldGenerator --------------------------------------- |
54 void GeneratePrivateMembers(io::Printer* printer) const; | 54 void GeneratePrivateMembers(io::Printer* printer) const; |
55 void GenerateAccessorDeclarations(io::Printer* printer) const; | 55 void GenerateAccessorDeclarations(io::Printer* printer) const; |
56 void GenerateInlineAccessorDefinitions(io::Printer* printer, | 56 void GenerateInlineAccessorDefinitions(io::Printer* printer, |
57 bool is_inline) const; | 57 bool is_inline) const; |
58 void GenerateClearingCode(io::Printer* printer) const; | 58 void GenerateClearingCode(io::Printer* printer) const; |
59 void GenerateMergingCode(io::Printer* printer) const; | 59 void GenerateMergingCode(io::Printer* printer) const; |
60 void GenerateSwappingCode(io::Printer* printer) const; | 60 void GenerateSwappingCode(io::Printer* printer) const; |
61 void GenerateConstructorCode(io::Printer* printer) const; | 61 void GenerateConstructorCode(io::Printer* printer) const; |
62 void GenerateCopyConstructorCode(io::Printer* printer) const; | |
63 void GenerateMergeFromCodedStream(io::Printer* printer) const; | 62 void GenerateMergeFromCodedStream(io::Printer* printer) const; |
64 void GenerateSerializeWithCachedSizes(io::Printer* printer) const; | 63 void GenerateSerializeWithCachedSizes(io::Printer* printer) const; |
65 void GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const; | 64 void GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const; |
66 void GenerateByteSize(io::Printer* printer) const; | 65 void GenerateByteSize(io::Printer* printer) const; |
67 | 66 |
68 protected: | 67 protected: |
69 const FieldDescriptor* descriptor_; | 68 const FieldDescriptor* descriptor_; |
70 std::map<string, string> variables_; | 69 map<string, string> variables_; |
71 | 70 |
72 private: | 71 private: |
73 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PrimitiveFieldGenerator); | 72 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PrimitiveFieldGenerator); |
74 }; | 73 }; |
75 | 74 |
76 class PrimitiveOneofFieldGenerator : public PrimitiveFieldGenerator { | 75 class PrimitiveOneofFieldGenerator : public PrimitiveFieldGenerator { |
77 public: | 76 public: |
78 PrimitiveOneofFieldGenerator(const FieldDescriptor* descriptor, | 77 PrimitiveOneofFieldGenerator(const FieldDescriptor* descriptor, |
79 const Options& options); | 78 const Options& options); |
80 ~PrimitiveOneofFieldGenerator(); | 79 ~PrimitiveOneofFieldGenerator(); |
(...skipping 18 matching lines...) Expand all Loading... |
99 | 98 |
100 // implements FieldGenerator --------------------------------------- | 99 // implements FieldGenerator --------------------------------------- |
101 void GeneratePrivateMembers(io::Printer* printer) const; | 100 void GeneratePrivateMembers(io::Printer* printer) const; |
102 void GenerateAccessorDeclarations(io::Printer* printer) const; | 101 void GenerateAccessorDeclarations(io::Printer* printer) const; |
103 void GenerateInlineAccessorDefinitions(io::Printer* printer, | 102 void GenerateInlineAccessorDefinitions(io::Printer* printer, |
104 bool is_inline) const; | 103 bool is_inline) const; |
105 void GenerateClearingCode(io::Printer* printer) const; | 104 void GenerateClearingCode(io::Printer* printer) const; |
106 void GenerateMergingCode(io::Printer* printer) const; | 105 void GenerateMergingCode(io::Printer* printer) const; |
107 void GenerateSwappingCode(io::Printer* printer) const; | 106 void GenerateSwappingCode(io::Printer* printer) const; |
108 void GenerateConstructorCode(io::Printer* printer) const; | 107 void GenerateConstructorCode(io::Printer* printer) const; |
109 void GenerateCopyConstructorCode(io::Printer* printer) const; | |
110 void GenerateMergeFromCodedStream(io::Printer* printer) const; | 108 void GenerateMergeFromCodedStream(io::Printer* printer) const; |
111 void GenerateMergeFromCodedStreamWithPacking(io::Printer* printer) const; | 109 void GenerateMergeFromCodedStreamWithPacking(io::Printer* printer) const; |
112 void GenerateSerializeWithCachedSizes(io::Printer* printer) const; | 110 void GenerateSerializeWithCachedSizes(io::Printer* printer) const; |
113 void GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const; | 111 void GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const; |
114 void GenerateByteSize(io::Printer* printer) const; | 112 void GenerateByteSize(io::Printer* printer) const; |
115 | 113 |
116 private: | 114 private: |
117 const FieldDescriptor* descriptor_; | 115 const FieldDescriptor* descriptor_; |
118 std::map<string, string> variables_; | 116 map<string, string> variables_; |
119 | 117 |
120 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedPrimitiveFieldGenerator); | 118 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedPrimitiveFieldGenerator); |
121 }; | 119 }; |
122 | 120 |
123 } // namespace cpp | 121 } // namespace cpp |
124 } // namespace compiler | 122 } // namespace compiler |
125 } // namespace protobuf | 123 } // namespace protobuf |
126 | 124 |
127 } // namespace google | 125 } // namespace google |
128 #endif // GOOGLE_PROTOBUF_COMPILER_CPP_PRIMITIVE_FIELD_H__ | 126 #endif // GOOGLE_PROTOBUF_COMPILER_CPP_PRIMITIVE_FIELD_H__ |
OLD | NEW |