诸暨麻将添加redis
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

207 lines
8.5 KiB

  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. // Author: kenton@google.com (Kenton Varda)
  31. // Based on original Protocol Buffers design by
  32. // Sanjay Ghemawat, Jeff Dean, and others.
  33. //
  34. // This proto file contains copies of TestAllTypes and friends, but with arena
  35. // support disabled in code generation. It allows us to test the performance
  36. // impact against baseline (non-arena) google.protobuf.
  37. syntax = "proto2";
  38. // Some generic_services option(s) added automatically.
  39. // See: http://go/proto2-generic-services-default
  40. option cc_generic_services = true; // auto-added
  41. option java_generic_services = true; // auto-added
  42. option py_generic_services = true; // auto-added
  43. option cc_enable_arenas = false;
  44. option objc_class_prefix = "NOARN";
  45. import "google/protobuf/unittest_import.proto";
  46. import "google/protobuf/unittest_arena.proto";
  47. // We don't put this in a package within proto2 because we need to make sure
  48. // that the generated code doesn't depend on being in the proto2 namespace.
  49. // In test_util.h we do "using namespace unittest = protobuf_unittest".
  50. package protobuf_unittest_no_arena;
  51. // Protos optimized for SPEED use a strict superset of the generated code
  52. // of equivalent ones optimized for CODE_SIZE, so we should optimize all our
  53. // tests for speed unless explicitly testing code size optimization.
  54. option optimize_for = SPEED;
  55. option java_outer_classname = "UnittestProto";
  56. // This proto includes every type of field in both singular and repeated
  57. // forms.
  58. message TestAllTypes {
  59. message NestedMessage {
  60. // The field name "b" fails to compile in proto1 because it conflicts with
  61. // a local variable named "b" in one of the generated methods. Doh.
  62. // This file needs to compile in proto1 to test backwards-compatibility.
  63. optional int32 bb = 1;
  64. }
  65. enum NestedEnum {
  66. FOO = 1;
  67. BAR = 2;
  68. BAZ = 3;
  69. NEG = -1; // Intentionally negative.
  70. }
  71. // Singular
  72. optional int32 optional_int32 = 1;
  73. optional int64 optional_int64 = 2;
  74. optional uint32 optional_uint32 = 3;
  75. optional uint64 optional_uint64 = 4;
  76. optional sint32 optional_sint32 = 5;
  77. optional sint64 optional_sint64 = 6;
  78. optional fixed32 optional_fixed32 = 7;
  79. optional fixed64 optional_fixed64 = 8;
  80. optional sfixed32 optional_sfixed32 = 9;
  81. optional sfixed64 optional_sfixed64 = 10;
  82. optional float optional_float = 11;
  83. optional double optional_double = 12;
  84. optional bool optional_bool = 13;
  85. optional string optional_string = 14;
  86. optional bytes optional_bytes = 15;
  87. optional group OptionalGroup = 16 {
  88. optional int32 a = 17;
  89. }
  90. optional NestedMessage optional_nested_message = 18;
  91. optional ForeignMessage optional_foreign_message = 19;
  92. optional protobuf_unittest_import.ImportMessage optional_import_message = 20;
  93. optional NestedEnum optional_nested_enum = 21;
  94. optional ForeignEnum optional_foreign_enum = 22;
  95. optional protobuf_unittest_import.ImportEnum optional_import_enum = 23;
  96. optional string optional_string_piece = 24 [ctype=STRING_PIECE];
  97. optional string optional_cord = 25 [ctype=CORD];
  98. // Defined in unittest_import_public.proto
  99. optional protobuf_unittest_import.PublicImportMessage
  100. optional_public_import_message = 26;
  101. optional NestedMessage optional_message = 27 [lazy=true];
  102. // Repeated
  103. repeated int32 repeated_int32 = 31;
  104. repeated int64 repeated_int64 = 32;
  105. repeated uint32 repeated_uint32 = 33;
  106. repeated uint64 repeated_uint64 = 34;
  107. repeated sint32 repeated_sint32 = 35;
  108. repeated sint64 repeated_sint64 = 36;
  109. repeated fixed32 repeated_fixed32 = 37;
  110. repeated fixed64 repeated_fixed64 = 38;
  111. repeated sfixed32 repeated_sfixed32 = 39;
  112. repeated sfixed64 repeated_sfixed64 = 40;
  113. repeated float repeated_float = 41;
  114. repeated double repeated_double = 42;
  115. repeated bool repeated_bool = 43;
  116. repeated string repeated_string = 44;
  117. repeated bytes repeated_bytes = 45;
  118. repeated group RepeatedGroup = 46 {
  119. optional int32 a = 47;
  120. }
  121. repeated NestedMessage repeated_nested_message = 48;
  122. repeated ForeignMessage repeated_foreign_message = 49;
  123. repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50;
  124. repeated NestedEnum repeated_nested_enum = 51;
  125. repeated ForeignEnum repeated_foreign_enum = 52;
  126. repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53;
  127. repeated string repeated_string_piece = 54 [ctype=STRING_PIECE];
  128. repeated string repeated_cord = 55 [ctype=CORD];
  129. repeated NestedMessage repeated_lazy_message = 57 [lazy=true];
  130. // Singular with defaults
  131. optional int32 default_int32 = 61 [default = 41 ];
  132. optional int64 default_int64 = 62 [default = 42 ];
  133. optional uint32 default_uint32 = 63 [default = 43 ];
  134. optional uint64 default_uint64 = 64 [default = 44 ];
  135. optional sint32 default_sint32 = 65 [default = -45 ];
  136. optional sint64 default_sint64 = 66 [default = 46 ];
  137. optional fixed32 default_fixed32 = 67 [default = 47 ];
  138. optional fixed64 default_fixed64 = 68 [default = 48 ];
  139. optional sfixed32 default_sfixed32 = 69 [default = 49 ];
  140. optional sfixed64 default_sfixed64 = 70 [default = -50 ];
  141. optional float default_float = 71 [default = 51.5 ];
  142. optional double default_double = 72 [default = 52e3 ];
  143. optional bool default_bool = 73 [default = true ];
  144. optional string default_string = 74 [default = "hello"];
  145. optional bytes default_bytes = 75 [default = "world"];
  146. optional NestedEnum default_nested_enum = 81 [default = BAR ];
  147. optional ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR];
  148. optional protobuf_unittest_import.ImportEnum
  149. default_import_enum = 83 [default = IMPORT_BAR];
  150. optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"];
  151. optional string default_cord = 85 [ctype=CORD,default="123"];
  152. // For oneof test
  153. oneof oneof_field {
  154. uint32 oneof_uint32 = 111;
  155. NestedMessage oneof_nested_message = 112;
  156. string oneof_string = 113;
  157. bytes oneof_bytes = 114;
  158. NestedMessage lazy_oneof_nested_message = 115 [lazy=true];
  159. }
  160. }
  161. // Define these after TestAllTypes to make sure the compiler can handle
  162. // that.
  163. message ForeignMessage {
  164. optional int32 c = 1;
  165. }
  166. enum ForeignEnum {
  167. FOREIGN_FOO = 4;
  168. FOREIGN_BAR = 5;
  169. FOREIGN_BAZ = 6;
  170. }
  171. message TestNoArenaMessage {
  172. optional proto2_arena_unittest.ArenaMessage arena_message = 1;
  173. };
  174. message OneString {
  175. optional string data = 1;
  176. }