100+ results for 'protobuf source:GoogleCode'

Not the results you expected?

RpcMessage.pb-c.c (https://code.google.com/p/protobuf-remote/) C · 430 lines ✨ Summary

This C code defines two message descriptors for Protocol Buffers, a data serialization format. The first descriptor defines a Parameter message with 10 fields and specifies their types and indices. The second descriptor defines an RpcMessage message with three fields: id, call_message, and result_message. These descriptors can be used to generate code for working with these messages in C.

76 PROTOBUF_C_TYPE_STRING,

77 0, /* quantifier_offset */

78 PROTOBUF_C_OFFSETOF(ProtoBufRemote__RpcMessage__Call, service),

79 NULL,

80 NULL,

278 PROTOBUF_C_OFFSETOF(ProtoBufRemote__RpcMessage__Parameter, has_uint64_param),

279 PROTOBUF_C_OFFSETOF(ProtoBufRemote__RpcMessage__Parameter, uint64_param),

280 NULL,

281 NULL,

290 PROTOBUF_C_OFFSETOF(ProtoBufRemote__RpcMessage__Parameter, has_bool_param),

291 PROTOBUF_C_OFFSETOF(ProtoBufRemote__RpcMessage__Parameter, bool_param),

292 NULL,

293 NULL,

302 PROTOBUF_C_OFFSETOF(ProtoBufRemote__RpcMessage__Parameter, has_float_param),

303 PROTOBUF_C_OFFSETOF(ProtoBufRemote__RpcMessage__Parameter, float_param),

304 NULL,

305 NULL,

RpcMessage.cs (https://code.google.com/p/protobuf-remote/) C# · 334 lines ✨ Summary

This C# code defines a class Parameter with multiple properties, each representing a different data type (e.g., boolean, float, double). The class includes getter and setter methods for each property, as well as an IsNull property that indicates whether the value is null. The class also implements the IExtensible interface to support extension objects.

19

20 private int _id;

21 [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]

22 public int Id

23 {

106

107 private string _errorMessage;

108 [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"error_message", DataFormat = global::ProtoBuf.DataFormat.Default)]

109 public string ErrorMessage

110 {

287

288 private double? _doubleParam;

289 [global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"double_param", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]

290 public double DoubleParam

291 {

328 private global::ProtoBuf.IExtension extensionObject;

329 global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)

330 { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }

test.pro.pb.h (http://d-protobuf.googlecode.com/svn/trunk/) C Header · 342 lines

77 ::google::protobuf::io::CodedOutputStream* output) const;

78 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

79 int GetCachedSize() const { return _cached_size_; }

80 private:

103 static ::google::protobuf::internal::ExtensionIdentifier< ::accc,

104 ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >

105 aaa;

106 // @@protoc_insertion_point(class_scope:SearchRequest)

107 private:

108 ::google::protobuf::UnknownFieldSet _unknown_fields_;

109 mutable int _cached_size_;

110

174 ::google::protobuf::io::CodedOutputStream* output) const;

175 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

176 int GetCachedSize() const { return _cached_size_; }

177 private:

protobuf-c-dispatch.h (http://protobuf-c.googlecode.com/svn/trunk/) C Header · 168 lines

44 typedef struct _ProtobufCDispatchTimer ProtobufCDispatchTimer;

45 typedef struct _ProtobufCDispatchIdle ProtobufCDispatchIdle;

46

47 #include "protobuf-c.h"

60

61 /* Create or destroy a Dispatch */

62 ProtobufCDispatch *protobuf_c_dispatch_new (ProtobufCAllocator *allocator);

63 void protobuf_c_dispatch_free(ProtobufCDispatch *dispatch);

65 ProtobufCDispatch *protobuf_c_dispatch_default (void);

66

67 ProtobufCAllocator *protobuf_c_dispatch_peek_allocator (ProtobufCDispatch *);

68

69 typedef void (*ProtobufCDispatchCallback) (ProtobufC_FD fd,

87 ProtobufCDispatchTimer *

88 protobuf_c_dispatch_add_timer(ProtobufCDispatch *dispatch,

89 unsigned timeout_secs,

90 unsigned timeout_usecs,

DelimiterTest.java (http://protostuff.googlecode.com/svn/trunk/) Java · 264 lines

65 ByteArrayOutputStream out = new ByteArrayOutputStream();

66 int size = writeDelimitedTo(out, message, schema, buf());

67 int delimSize = ProtobufOutput.computeRawVarint32Size(size);

68 byte[] data = out.toByteArray();

69

96 ByteArrayOutputStream out = new ByteArrayOutputStream();

97 int size = optWriteDelimitedTo(out, message, schema, buf());

98 int delimSize = ProtobufOutput.computeRawVarint32Size(size);

99 byte[] data = out.toByteArray();

100

119 ByteArrayOutputStream out = new ByteArrayOutputStream();

120 int size = optWriteDelimitedTo(out, message, schema, buf());

121 int delimSize = ProtobufOutput.computeRawVarint32Size(size);

122 byte[] data = out.toByteArray();

123

StreamRpcChannelTest.cpp (https://code.google.com/p/linux-lighting/) C++ · 204 lines

20

21 #include <cppunit/extensions/HelperMacros.h>

22 #include <google/protobuf/stubs/common.h>

23 #include <string>

24 #include "ola/io/SelectServer.h"

28 #include "common/rpc/TestService.pb.h"

29

30 using google::protobuf::NewCallback;

31 using ola::io::LoopbackDescriptor;

32 using ola::io::SelectServer;

48 ~TestServiceImpl() {}

49

50 void Echo(::google::protobuf::RpcController* controller,

51 const EchoRequest* request,

52 EchoReply* response,

spinn3rApi.proto (https://code.google.com/p/spinn3r-client/) Protocol Buffers · 340 lines ✨ Summary

This Protocol Buffers code defines a set of messages for data exchange, including RSS feeds, comments, and social media platforms like Twitter. It provides structured data formats for various types of content, such as entries, responses, and individual items within those entries. The messages are designed to be efficient and flexible, allowing for easy adaptation to different use cases and data sources.

7 protoc --proto_path=src/proto --java_out=src/java src/proto/spinn3rApi.proto

8 ant compile

9 svn commit -m "new protobufs"

10

11 */

13 package contentApi;

14

15 option java_package = "com.spinn3r.api.protobuf";

16 option java_outer_classname = "ContentApi";

17

MessageWrapper.as (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) ActionScript · 111 lines

13 import com.jediflasher.game_client.server.messages.ServiceType;

14 import com.jediflasher.game_client.server.messages.WorldInfoResponse;

15 import com.netease.protobuf.Message;

16

17 import flash.utils.IDataInput;

Simulator.java (https://code.google.com/p/synoptic/) Java · 187 lines

4 import prototrace.ProtoTrace.PingPongMessage;

5 import prototrace.ProtoTrace.Trace;

6 import com.google.protobuf.ByteString;

7 import java.io.FileOutputStream;

8 import java.util.Random;

MediaContentHolderNumericJSON.java (http://thrift-protobuf-compare.googlecode.com/svn/trunk/) Java · 386 lines

50

51

52 static final ProtobufConvertor<MediaContent,MediaContent.Builder> CONVERTOR_MediaContent = new ProtobufConvertor<MediaContent,MediaContent.Builder>()

53 {

54

128

129

130 static final ProtobufConvertor<Media,Media.Builder> CONVERTOR_Media = new ProtobufConvertor<Media,Media.Builder>()

131 {

132

293

294

295 static final ProtobufConvertor<Image,Image.Builder> CONVERTOR_Image = new ProtobufConvertor<Image,Image.Builder>()

296 {

297

WireFormat.java (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) Java · 164 lines

1 // Protocol Buffers - Google's data interchange format

2 // Copyright 2008 Google Inc. All rights reserved.

3 // http://code.google.com/p/protobuf/

4 //

5 // Redistribution and use in source and binary forms, with or without

29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

30

31 package com.google.protobuf;

32

33 /**

34 * This class is used internally by the Protocol Buffer library and generated

35 * message implementations. It is public only because those generated messages

36 * do not reside in the {@code protobuf} package. Others should not use this

37 * class directly.

38 *

UserProto.java (http://flex-mmorpg-server.googlecode.com/svn/trunk/) Java · 408 lines

3 package com.glu.rpc.service;

4

5 import com.google.protobuf.UninitializedMessageException;

6

7 public final class UserProto {

8 private UserProto() {}

9 public static void registerAllExtensions(

10 com.google.protobuf.ExtensionRegistry registry) {

11 }

12 public static final class User extends

13 com.google.protobuf.GeneratedMessage {

14 // Use User.newBuilder() to construct.

15 private User() {}

Generators.h (https://code.google.com/p/protobuf-remote/) C Header · 214 lines ✨ Summary

This C header code defines a set of macros and functions for creating stubs, stub calls, and stub implementations for remote procedure calls (RPCs) in a networked application. It provides a way to generate stub methods that can be used as placeholders for RPC calls, allowing the compiler to generate efficient stub code at compile-time.

3

4 #include <boost/preprocessor.hpp>

5 #include "ProtoBufRemote/PendingCall.h"

6 #include "ProtoBufRemote/Proxy.h"

7 #include "ProtoBufRemote/RpcClient.h"

8 #include "ProtoBufRemote/RpcService.h"

26 */

27 #define PBR_PROXY(name, methods) \

28 class name##Proxy : public ::ProtoBufRemote::Proxy \

29 { \

30 public: \

31 name##Proxy(::ProtoBufRemote::RpcClient* client) : ::ProtoBufRemote::Proxy(client, #name) { } \

32 BOOST_PP_SEQ_FOR_EACH(PBR_X_PROXY_METHOD, ~, methods) \

33 };

SampleServiceParameters.cs (https://code.google.com/p/protobuf-remote/) C# · 71 lines ✨ Summary

This C# code defines two classes, MultiplyInput and MultiplyOutput, which represent input and output parameters for a multiplication operation. The classes have properties for prefix, first number, second number, result string, and result number, with data formats specified using Protocol Buffers. They also inherit from the IExtensible interface to support extensions.

18

19 private string _prefix = "";

20 [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"prefix", DataFormat = global::ProtoBuf.DataFormat.Default)]

21 [global::System.ComponentModel.DefaultValue("")]

22 public string Prefix

41 private global::ProtoBuf.IExtension extensionObject;

42 global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)

43 { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }

57 }

58 private int _resultNumber;

59 [global::ProtoBuf.ProtoMember(11, IsRequired = true, Name=@"result_number", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]

60 public int ResultNumber

61 {

65 private global::ProtoBuf.IExtension extensionObject;

66 global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)

67 { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }

MessageFormatOptions.cs (https://code.google.com/p/protobuf-csharp-port/) C# · 167 lines

14 /// <remarks>Other valid xml mime types include: application/binary, application/x-protobuf</remarks>

15 public const string ContentTypeProtoBuffer = "application/vnd.google.protobuf";

16

17 /// <summary>The mime type for xml content</summary>

47 {"application/xml", XmlFormatReader.CreateInstance},

48 {"application/binary", CodedInputStream.CreateInstance},

49 {"application/x-protobuf", CodedInputStream.CreateInstance},

50 {"application/vnd.google.protobuf", CodedInputStream.CreateInstance},

70 {"application/xml", XmlFormatWriter.CreateInstance},

71 {"application/binary", CodedOutputStream.CreateInstance},

72 {"application/x-protobuf", CodedOutputStream.CreateInstance},

73 {"application/vnd.google.protobuf", CodedOutputStream.CreateInstance},

client_test.py (https://code.google.com/p/grr/) Python · 182 lines

34

35 class MockAction(actions.ActionPlugin):

36 in_protobuf = jobs_pb2.PrintStr

37 out_protobuf = jobs_pb2.PrintStr

44 class RaiseAction(actions.ActionPlugin):

45 """A mock action which raises an error."""

46 in_protobuf = jobs_pb2.PrintStr

47 out_protobuf = jobs_pb2.PrintStr

java_message_field.h (http://protobuf.googlecode.com/svn/trunk/) C Header · 137 lines

1 // Protocol Buffers - Google's data interchange format

2 // Copyright 2008 Google Inc. All rights reserved.

3 // http://code.google.com/p/protobuf/

4 //

5 // Redistribution and use in source and binary forms, with or without

33 // Sanjay Ghemawat, Jeff Dean, and others.

34

35 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_FIELD_H__

36 #define GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_FIELD_H__

38 #include <map>

39 #include <string>

40 #include <google/protobuf/compiler/java/java_field.h>

41

42 namespace google {

43 namespace protobuf {

44 namespace compiler {

45 namespace java {

RpcMessage.pb-c.h (https://code.google.com/p/protobuf-remote/) C Header · 146 lines ✨ Summary

This C header file defines a protocol buffer message structure for remote procedure calls (RPCs). It includes definitions for RPC messages, call parameters, and result structures, as well as functions for initializing and packing these structures. The code is generated by a protocol buffer compiler and should not be edited manually. It provides a way to serialize and deserialize RPC messages in C programs.

1 /* Generated by the protocol buffer compiler. DO NOT EDIT! */

2

3 #ifndef PROTOBUF_C_RpcMessage_2eproto__INCLUDED

4 #define PROTOBUF_C_RpcMessage_2eproto__INCLUDED

5

6 #include <framework/protobuf/protobuf-c.h>

7

8 PROTOBUF_C_BEGIN_DECLS

9

10

11 typedef struct _ProtoBufRemote__RpcMessage ProtoBufRemote__RpcMessage;

12 typedef struct _ProtoBufRemote__RpcMessage__Call ProtoBufRemote__RpcMessage__Call;

13 typedef struct _ProtoBufRemote__RpcMessage__Result ProtoBufRemote__RpcMessage__Result;

14 typedef struct _ProtoBufRemote__RpcMessage__Parameter ProtoBufRemote__RpcMessage__Parameter;

save.go (https://code.google.com/p/appengine-go/) Go · 248 lines

13

14 "appengine"

15 "code.google.com/p/goprotobuf/proto"

16

17 pb "appengine_internal/datastore"

User.java (http://flex-mmorpg-server.googlecode.com/svn/trunk/) Java · 184 lines

5 import java.io.InputStream;

6

7 import net.jarlehansen.protobuf.javame.UninitializedMessageException;

8 import net.jarlehansen.protobuf.javame.factory.JavaMeProtoFactory;

9 import net.jarlehansen.protobuf.javame.input.DelimitedInputStream;

10 import net.jarlehansen.protobuf.javame.input.DelimitedSizeUtil;

11 import net.jarlehansen.protobuf.javame.input.InputReader;

12 import net.jarlehansen.protobuf.javame.input.taghandler.DefaultUnknownTagHandlerImpl;

13 import net.jarlehansen.protobuf.javame.input.taghandler.UnknownTagHandler;

14 import net.jarlehansen.protobuf.javame.output.AbstractOutputWriter;

15 import net.jarlehansen.protobuf.javame.output.OutputWriter;

16 import net.jarlehansen.protobuf.javame.util.ComputeSizeUtil;

UnitInfoContainerTests.cs (http://hfm-net.googlecode.com/svn/trunk/) C# · 0 lines

39

40 [Test]

41 public void ProtoBufSerializationTest()

42 {

43 UnitInfoContainer.Serialize(_collection, "UnitInfoProtoBufTest.dat");

44

45 UnitInfoCollection collection2 = UnitInfoContainer.Deserialize("UnitInfoProtoBufTest.dat");

46 ValidateTestCollection(collection2);

47 }

48

49 [Test]

50 public void ProtoBufDeserializeFileNotFoundTest()

51 {

52 UnitInfoCollection testCollection = UnitInfoContainer.Deserialize("FileNotFound.dat");

fake_callbacks.h (http://maidsafe-dht.googlecode.com/svn/trunk/) C Header · 210 lines

34 #include <string>

35 #include "maidsafe/maidsafe-dht_config.h"

36 #include "maidsafe/protobuf/general_messages.pb.h"

37 #include "maidsafe/protobuf/kademlia_service_messages.pb.h"

URLConnectionStrategy.java (http://google-secure-data-connector.googlecode.com/svn/trunk/) Java · 89 lines

29 import com.google.dataconnector.protocol.proto.SdcFrame.FetchReply;

30 import com.google.dataconnector.protocol.proto.SdcFrame.FetchRequest;

31 import com.google.protobuf.ByteString;

32

33 /**

cxx-generate-packed-data.cc (http://protobuf-c.googlecode.com/svn/trunk/) C++ · 1058 lines

28 using namespace foo;

29

30 #define protobuf_c_boolean bool

31 #define TEST_ENUM_SMALL_TYPE_NAME TestEnumSmall

32 #define TEST_ENUM_SMALL(NAME) foo::NAME

37

38 static void

39 dump_message_bytes(google::protobuf::Message *message,

40 const char *label)

41 {

948 {

949 EmptyMess mess;

950 const google::protobuf::Message::Reflection *reflection = mess.GetReflection();

951 google::protobuf::UnknownFieldSet *fs = reflection->MutableUnknownFields(&mess);

952

953 #if GOOGLE_PROTOBUF_VERSION >= 2001000

954 fs->AddVarint(5454, 255);

955 fs->AddFixed32(5555, 260);

UnitTestExtrasLiteProtoFile.cs (https://code.google.com/p/protobuf-csharp-port/) C# · 3645 lines

78 global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.EmployeeIdLite =

79 new pb::GeneratedExtensionLite<global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite, global::Google.ProtocolBuffers.TestProtos.TestInteropEmployeeIdLite>(

80 "protobuf_unittest_extra.employee_id_lite",

81 global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.DefaultInstance,

82 null,

87 global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedInt32ExtensionLite =

88 new pb::GeneratedRepeatExtensionLite<global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite, int>(

89 "protobuf_unittest_extra.unpacked_int32_extension_lite",

90 global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance,

91 null,

96 global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedInt64ExtensionLite =

97 new pb::GeneratedRepeatExtensionLite<global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite, long>(

98 "protobuf_unittest_extra.unpacked_int64_extension_lite",

99 global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance,

100 null,

CodedOutputStream.ComputeSize.cs (https://code.google.com/p/protobuf-csharp-port/) C# · 653 lines

3 // Protocol Buffers - Google's data interchange format

4 // Copyright 2008 Google Inc. All rights reserved.

5 // http://github.com/jskeet/dotnet-protobufs/

6 // Original C++/Java/Python code:

7 // http://code.google.com/p/protobuf/

codegen.scm (http://r6rs-protobuf.googlecode.com/svn/trunk/) Scheme · 794 lines

1 ;; codegen.scm: code generation API for r6rs-protobuf

2 ;; Copyright (C) 2011 Julian Graham

3

4 ;; r6rs-protobuf is free software: you can redistribute it and/or modify

5 ;; it under the terms of the GNU General Public License as published by

6 ;; the Free Software Foundation, either version 3 of the License, or

17 #!r6rs

18

19 (library (protobuf compile codegen)

20 (export protoc:default-naming-context

21

30 protoc:generate-builder)

31 (import (rnrs)

32 (protobuf compile parse)

33 (protobuf private)

parse.scm (http://r6rs-protobuf.googlecode.com/svn/trunk/) Scheme · 800 lines

1 ;; parse.scm: .proto format parsing routines for r6rs-protobuf

2 ;; Copyright (C) 2011 Julian Graham

3

4 ;; r6rs-protobuf is free software: you can redistribute it and/or modify

5 ;; it under the terms of the GNU General Public License as published by

6 ;; the Free Software Foundation, either version 3 of the License, or

17 #!r6rs

18

19 (library (protobuf compile parse)

20 (export protoc:make-parser

21

91 protoc:field-definition-options)

92 (import (rnrs)

93 (protobuf private)

94 (protobuf compile tokenize)

private.scm (http://r6rs-protobuf.googlecode.com/svn/trunk/) Scheme · 635 lines

20 (export protobuf:make-field-type-descriptor

21 protobuf:field-type-descriptor-default

22 protobuf:field-type-descriptor-name

23 protobuf:field-type-descriptor-predicate

24 protobuf:field-type-descriptor-wire-type

75 protobuf:message-field

76 protobuf:message-has-extension?

77 protobuf:message-write

140 (put-bytevector port vec)))

141

142 (define (protobuf:write-int32 port int32) (protobuf:write-varint port int32))

143 (define (protobuf:write-int64 port int64) (protobuf:write-varint port int64))

151 (protobuf:write-varint port (zigzag-encode sint64 64)))

152 (define (protobuf:write-fixed32 port fixed32)

153 (let ((vec (make-bytevector 4)))

154 (bytevector-u32-set! vec 0 fixed32 (endianness little))

NepoolProto.java (http://findataweb.googlecode.com/svn/trunk/) Java · 2542 lines

7 private NepoolProto() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public interface PriceQuantityPairOrBuilder

12 extends com.google.protobuf.MessageOrBuilder {

13

14 // required double price = 1;

21 }

22 public static final class PriceQuantityPair extends

23 com.google.protobuf.GeneratedMessage

24 implements PriceQuantityPairOrBuilder {

25 // Use PriceQuantityPair.newBuilder() to construct.

TimeseriesProto.java (http://findataweb.googlecode.com/svn/trunk/) Java · 2579 lines

8 private TimeseriesProto() {}

9 public static void registerAllExtensions(

10 com.google.protobuf.ExtensionRegistry registry) {

11 }

12 public interface ObservationOrBuilder

13 extends com.google.protobuf.MessageOrBuilder {

14

15 // required int64 dtStart = 1;

26 }

27 public static final class Observation extends

28 com.google.protobuf.GeneratedMessage

29 implements ObservationOrBuilder {

30 // Use Observation.newBuilder() to construct.

MediaContentHolder.java (http://thrift-protobuf-compare.googlecode.com/svn/trunk/) Java · 2452 lines

569

570 public void writeFramed(java.io.OutputStream output) throws java.io.IOException {

571 org.apache.activemq.protobuf.CodedOutputStream codedOutput = new org.apache.activemq.protobuf.CodedOutputStream(output);

572 writeFramed(codedOutput);

573 codedOutput.flush();

658 }

659

660 public static ImageBuffer parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {

661 int length = data.readRawVarint32();

662 int oldLimit = data.pushLimit(length);

668 public static ImageBuffer parseFramed(org.apache.activemq.util.buffer.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {

669 try {

670 org.apache.activemq.protobuf.CodedInputStream input = new org.apache.activemq.protobuf.CodedInputStream(data);

671 ImageBuffer rc = parseFramed(input);

672 input.checkLastTagWas(0);

MediaContentHolderJSON.java (http://thrift-protobuf-compare.googlecode.com/svn/trunk/) Java · 462 lines

51

52

53 static final ProtobufConvertor<MediaContent,MediaContent.Builder> CONVERTOR_MediaContent = new ProtobufConvertor<MediaContent,MediaContent.Builder>()

54 {

55 final HashMap<String,Integer> fieldMap = new HashMap<String,Integer>();

146

147

148 static final ProtobufConvertor<Media,Media.Builder> CONVERTOR_Media = new ProtobufConvertor<Media,Media.Builder>()

149 {

150 final HashMap<String,Integer> fieldMap = new HashMap<String,Integer>();

346

347

348 static final ProtobufConvertor<Image,Image.Builder> CONVERTOR_Image = new ProtobufConvertor<Image,Image.Builder>()

349 {

350 final HashMap<String,Integer> fieldMap = new HashMap<String,Integer>();

MediaContentHolder.java (http://thrift-protobuf-compare.googlecode.com/svn/trunk/) Java · 1983 lines

24 public static final com.google.protobuf.Descriptors.Descriptor

25 getDescriptor() {

26 return serializers.protobuf.MediaContentHolder.internal_static_serializers_protobuf_Image_descriptor;

27 }

28

29 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable

30 internalGetFieldAccessorTable() {

31 return serializers.protobuf.MediaContentHolder.internal_static_serializers_protobuf_Image_fieldAccessorTable;

32 }

33

128 public static final int SIZE_FIELD_NUMBER = 5;

129 private boolean hasSize;

130 private serializers.protobuf.MediaContentHolder.Image.Size size_ = serializers.protobuf.MediaContentHolder.Image.Size.SMALL;

131 public boolean hasSize() { return hasSize; }

132 public serializers.protobuf.MediaContentHolder.Image.Size getSize() { return size_; }

Messages.java (http://cmecab-java.googlecode.com/svn/trunk/) Java · 1673 lines

7 private Messages() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public interface ParsingRequestOrBuilder

12 extends com.google.protobuf.MessageOrBuilder {

13

14 // required string text = 1;

17 }

18 public static final class ParsingRequest extends

19 com.google.protobuf.GeneratedMessage

20 implements ParsingRequestOrBuilder {

21 // Use ParsingRequest.newBuilder() to construct.

test.pro2.pb.h (http://d-protobuf.googlecode.com/svn/trunk/) C Header · 721 lines

95 ::google::protobuf::io::CodedOutputStream* output) const;

96 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

97 int GetCachedSize() const { return _cached_size_; }

98 private:

182 ::google::protobuf::io::CodedOutputStream* output) const;

183 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

184 int GetCachedSize() const { return _cached_size_; }

185 private:

271 ::google::protobuf::io::CodedOutputStream* output) const;

272 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

273 int GetCachedSize() const { return _cached_size_; }

274 private:

303 static ::google::protobuf::internal::ExtensionIdentifier< ::ccc2_ccc3,

304 ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int64 >, 3, false >

305 quersyd;

306 static const int kQuersyFieldNumber = 11;

DescriptorProtos.java (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) Java · 14806 lines

2 // source: descriptor.proto

3

4 package com.google.protobuf;

5

6 public final class DescriptorProtos {

12 extends MessageOrBuilder {

13

14 // repeated .google.protobuf.FileDescriptorProto file = 1;

15 java.util.List<FileDescriptorProto>

16 getFileList();

42 public static final Descriptors.Descriptor

43 getDescriptor() {

44 return DescriptorProtos.internal_static_google_protobuf_FileDescriptorSet_descriptor;

45 }

46

RequestCharacterMove.java (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) Java · 448 lines

7 private RequestCharacterMove() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public interface CharacterMoveRequestOrBuilder

12 extends com.google.protobuf.MessageOrBuilder {

13

14 // optional int32 xPos = 2;

21 }

22 public static final class CharacterMoveRequest extends

23 com.google.protobuf.GeneratedMessage

24 implements CharacterMoveRequestOrBuilder {

25 // Use CharacterMoveRequest.newBuilder() to construct.

RequestWorldInfo.java (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) Java · 906 lines

7 private RequestWorldInfo() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public interface WorldInfoRequestOrBuilder

12 extends com.google.protobuf.MessageOrBuilder {

13

14 // optional int32 user_id = 1;

25 }

26 public static final class WorldInfoRequest extends

27 com.google.protobuf.GeneratedMessage

28 implements WorldInfoRequestOrBuilder {

29 // Use WorldInfoRequest.newBuilder() to construct.

RequestMessageLogin.java (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) Java · 1028 lines

7 private RequestMessageLogin() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public interface LoginRequestOrBuilder

12 extends com.google.protobuf.MessageOrBuilder {

13

14 // required string login = 1;

21 }

22 public static final class LoginRequest extends

23 com.google.protobuf.GeneratedMessage

24 implements LoginRequestOrBuilder {

25 // Use LoginRequest.newBuilder() to construct.

HeaderMessage.java (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) Java · 856 lines

7 private HeaderMessage() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public enum MessageType

12 implements com.google.protobuf.ProtocolMessageEnum {

13 REQUEST(0, 1),

14 RESPONSE(1, 2),

32 }

33

34 public static com.google.protobuf.Internal.EnumLiteMap<MessageType>

35 internalGetValueMap() {

36 return internalValueMap;

RequestCharacterInfo.java (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) Java · 953 lines

7 private RequestCharacterInfo() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public interface CharacterInfoRequestOrBuilder

12 extends com.google.protobuf.MessageOrBuilder {

13

14 // optional int32 character_id = 1;

17 }

18 public static final class CharacterInfoRequest extends

19 com.google.protobuf.GeneratedMessage

20 implements CharacterInfoRequestOrBuilder {

21 // Use CharacterInfoRequest.newBuilder() to construct.

ProtoTrace.java (https://code.google.com/p/synoptic/) Java · 3402 lines

80 public static final int PAYLOAD_FIELD_NUMBER = 4;

81 private boolean hasPayload;

82 private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY;

83

84 public boolean hasPayload() {

336 com.google.protobuf.ExtensionRegistryLite extensionRegistry)

337 throws java.io.IOException {

338 com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet

339 .newBuilder(this.getUnknownFields());

340 while (true) {

797 com.google.protobuf.ExtensionRegistryLite extensionRegistry)

798 throws java.io.IOException {

799 com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet

800 .newBuilder(this.getUnknownFields());

801 while (true) {

MessageTrace.java (https://code.google.com/p/synoptic/) Java · 1328 lines

93 public static final int THE_MESSAGE_FIELD_NUMBER = 5;

94 private boolean hasTheMessage;

95 private com.google.protobuf.ByteString theMessage_ = com.google.protobuf.ByteString.EMPTY;

96

97 public boolean hasTheMessage() {

361 com.google.protobuf.ExtensionRegistryLite extensionRegistry)

362 throws java.io.IOException {

363 com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet

364 .newBuilder(this.getUnknownFields());

365 while (true) {

792 com.google.protobuf.ExtensionRegistryLite extensionRegistry)

793 throws java.io.IOException {

794 com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet

795 .newBuilder(this.getUnknownFields());

796 while (true) {

ProtoTrace.java (https://code.google.com/p/synoptic/) Java · 1312 lines

7 private ProtoTrace() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public static final class GenericMessage extends

12 com.google.protobuf.GeneratedMessage {

13 // Use GenericMessage.newBuilder() to construct.

14 private GenericMessage() {

60 public static final int PAYLOAD_FIELD_NUMBER = 4;

61 private boolean hasPayload;

62 private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY;

63 public boolean hasPayload() { return hasPayload; }

64 public com.google.protobuf.ByteString getPayload() { return payload_; }

Test.c (http://protobuf-embedded-c.googlecode.com/svn/trunk/) C · 1154 lines

8 * *

9 * Source : Test.proto

10 * Package: edu.tum.cs.ccts.protobuf.embedded

11 * *

12 * Do not edit. *

SmileFormat.java (http://protobuf-java-format.googlecode.com/svn/trunk/) Java · 82 lines

1 package com.googlecode.protobuf.format;

2 /*

3 Copyright (c) 2009, Orbitz World Wide

40 import org.codehaus.jackson.smile.SmileParser;

41

42 import com.google.protobuf.ExtensionRegistry;

43 import com.google.protobuf.Message;

45 /**

46 * Provide ascii text parsing and formatting support for proto2 instances. The implementation

47 * largely follows google/protobuf/text_format.cc.

48 * <p>

49 * (c) 2011 Neustar, Inc. All Rights Reserved.

Header.as (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) ActionScript · 206 lines

116 override public final function writeToBuffer(output:com.netease.protobuf.WritingBuffer):void {

117 if (hasRequestId) {

118 com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 1);

119 com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, request_id$field);

126 com.netease.protobuf.WriteUtils.write$TYPE_ENUM(output, messageType);

127 if (hasMethod) {

128 com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 4);

129 com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, method$field);

130 }

131 com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 5);

132 com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, bodySize);

133 if (hasUserId) {

134 com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 6);

135 com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, user_id$field);

TestMimeMessageFormats.cs (https://code.google.com/p/protobuf-csharp-port/) C# · 264 lines

16 readonly IEnumerable<string> JsonTypes = new string[] { "application/json", "application/x-json", "application/x-javascript", "text/javascript", "text/x-javascript", "text/x-json", "text/json" };

17 readonly IEnumerable<string> XmlTypes = new string[] { "text/xml", "application/xml" };

18 readonly IEnumerable<string> ProtobufTypes = new string[] { "application/binary", "application/x-protobuf", "application/vnd.google.protobuf" };

19

20 [TestMethod]

73 public void TestReadProtoMimeTypes()

74 {

75 foreach (string type in ProtobufTypes)

76 {

77 Assert.IsTrue(

80 }

81 Assert.IsTrue(

82 MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/vnd.google.protobuf" }, null, Stream.Null)

83 is CodedInputStream);

84 }

ServiceThunkHelpers.cs (https://code.google.com/p/protobuf-remote/) C# · 177 lines ✨ Summary

This C# code provides a set of static helper methods within the ServiceThunkHelpers class, used to validate and convert data from RPC messages into various data types such as integers, floats, strings, and protobuf objects. These methods check for parameter counts, conversion errors, and return boolean values indicating success or failure.

2 using System.Collections.Generic;

3

4 namespace ProtoBufRemote

5 {

6 internal static class ServiceThunkHelpers

167 resultMessage.IsFailed = true;

168 resultMessage.ErrorMessage =

169 String.Format("Cannot convert call parameter value into expected protobuf type ({0})", error);

170 }

171 return false;

blobstore_service.pb.go (https://code.google.com/p/appengine-go/) Go · 167 lines

4 package appengine

5

6 import proto "code.google.com/p/goprotobuf/proto"

7 import "math"

8

61

62 type CreateUploadURLRequest struct {

63 SuccessPath *string `protobuf:"bytes,1,req,name=success_path" json:"success_path,omitempty"`

64 MaxUploadSizeBytes *int64 `protobuf:"varint,2,opt,name=max_upload_size_bytes" json:"max_upload_size_bytes,omitempty"`

65 MaxUploadSizePerBlobBytes *int64 `protobuf:"varint,3,opt,name=max_upload_size_per_blob_bytes" json:"max_upload_size_per_blob_bytes,omitempty"`

66 XXX_unrecognized []byte `json:"-"`

67 }

71

72 type CreateUploadURLResponse struct {

73 Url *string `protobuf:"bytes,1,req,name=url" json:"url,omitempty"`

74 XXX_unrecognized []byte `json:"-"`

75 }

test_util.h (http://decs.googlecode.com/svn/trunk/) C Header · 157 lines

1 // Protocol Buffers - Google's data interchange format

2 // Copyright 2008 Google Inc. All rights reserved.

3 // http://code.google.com/p/protobuf/

4 //

5 // Redistribution and use in source and binary forms, with or without

33 // Sanjay Ghemawat, Jeff Dean, and others.

34

35 #ifndef GOOGLE_PROTOBUF_TEST_UTIL_H__

36 #define GOOGLE_PROTOBUF_TEST_UTIL_H__

38 #include <stack>

39 #include <string>

40 #include <google/protobuf/message.h>

41 #include <google/protobuf/unittest.pb.h>

42

43 namespace google {

44 namespace protobuf {

45

46 namespace unittest = protobuf_unittest;

channel.cc (http://maidsafe-dht.googlecode.com/svn/trunk/) C++ · 158 lines

60 }

61

62 void Controller::NotifyOnCancel(google::protobuf::Closure* done) {

63 controller_pimpl_->NotifyOnCancel(done);

64 }

136 Channel::~Channel() {}

137

138 void Channel::CallMethod(const google::protobuf::MethodDescriptor *method,

139 google::protobuf::RpcController *controller,

140 const google::protobuf::Message *request,

141 google::protobuf::Message *response,

142 google::protobuf::Closure *done) {

143 pimpl_->CallMethod(method, controller, request, response, done);

144 }

ChangeUsers.as (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) ActionScript · 90 lines

12 public dynamic final class ChangeUsers extends com.netease.protobuf.Message {

13 public static const REMOVED:FieldDescriptor$TYPE_BOOL = new FieldDescriptor$TYPE_BOOL("com.jediflasher.game_client.server.messages.ChangeUsers.removed", "removed", (1 << 3) | com.netease.protobuf.WireType.VARINT);

14

15 private var removed$field:Boolean;

45 override public final function writeToBuffer(output:com.netease.protobuf.WritingBuffer):void {

46 if (hasRemoved) {

47 com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 1);

48 com.netease.protobuf.WriteUtils.write$TYPE_BOOL(output, removed$field);

49 }

50 for (var usersIndex:uint = 0; usersIndex < users.length; ++usersIndex) {

51 com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 2);

52 com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, users[usersIndex]);

75 if ((tag & 7) == com.netease.protobuf.WireType.LENGTH_DELIMITED) {

76 com.netease.protobuf.ReadUtils.readPackedRepeated(input, com.netease.protobuf.ReadUtils.read$TYPE_INT32, users);

77 break;

78 }

Protos.java (https://code.google.com/p/bitcoinj/) Java · 12764 lines

7 private Protos() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public interface PeerAddressOrBuilder

12 extends com.google.protobuf.MessageOrBuilder {

13

14 // required bytes ip_address = 1;

482

483 // required bytes ip_address = 1;

484 private com.google.protobuf.ByteString ipAddress_ = com.google.protobuf.ByteString.EMPTY;

485 /**

486 * <code>required bytes ip_address = 1;</code>

market.proto.php (http://android-market-api-php.googlecode.com/svn/trunk/) PHP · 3888 lines

161 break;

162 default:

163 $this->_unknown[$field . '-' . Protobuf::get_wiretype($wire)][] = Protobuf::read_field($fp, $wire, $limit);

164 }

165 }

385 break;

386 default:

387 $this->_unknown[$field . '-' . Protobuf::get_wiretype($wire)][] = Protobuf::read_field($fp, $wire, $limit);

388 }

389 }

540 break;

541 default:

542 $this->_unknown[$field . '-' . Protobuf::get_wiretype($wire)][] = Protobuf::read_field($fp, $wire, $limit);

543 }

544 }

playerInfo.pb.h (http://acunis-emag.googlecode.com/svn/trunk/) C Header · 763 lines

2 // source: playerInfo.proto

3

4 #ifndef PROTOBUF_playerInfo_2eproto__INCLUDED

5 #define PROTOBUF_playerInfo_2eproto__INCLUDED

78 ::google::protobuf::io::CodedOutputStream* output) const;

79 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

80 int GetCachedSize() const { return _cached_size_; }

81 private:

183 ::google::protobuf::io::CodedOutputStream* output) const;

184 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

185 int GetCachedSize() const { return _cached_size_; }

186 private:

288 ::google::protobuf::io::CodedOutputStream* output) const;

289 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

290 int GetCachedSize() const { return _cached_size_; }

291 private:

memcache_service.pb.go (https://code.google.com/p/appengine-go/) Go · 420 lines

4 package appengine

5

6 import proto "code.google.com/p/goprotobuf/proto"

7 import "math"

8

190

191 type AppOverride struct {

192 AppId *string `protobuf:"bytes,1,req,name=app_id" json:"app_id,omitempty"`

193 NumMemcachegBackends *int32 `protobuf:"varint,2,req,name=num_memcacheg_backends" json:"num_memcacheg_backends,omitempty"`

194 IgnoreShardlock *bool `protobuf:"varint,3,opt,name=ignore_shardlock" json:"ignore_shardlock,omitempty"`

195 MemcachePoolHint *string `protobuf:"bytes,4,opt,name=memcache_pool_hint" json:"memcache_pool_hint,omitempty"`

201

202 type MemcacheGetRequest struct {

203 Key [][]byte `protobuf:"bytes,1,rep,name=key" json:"key,omitempty"`

204 NameSpace *string `protobuf:"bytes,2,opt,name=name_space" json:"name_space,omitempty"`

CalculatorServiceImpl.java (http://netty-protobuf-rpc.googlecode.com/svn/trunk/) Java · 137 lines

20 * THE SOFTWARE.

21 */

22 package com.googlecode.protobuf.netty.example;

23

24 import org.apache.log4j.Logger;

25

26 import com.google.protobuf.RpcCallback;

27 import com.google.protobuf.RpcController;

28 import com.google.protobuf.ServiceException;

29 import com.googlecode.protobuf.netty.example.Calculator.CalcRequest;

30 import com.googlecode.protobuf.netty.example.Calculator.CalcResponse;

31

32 public class CalculatorServiceImpl implements Calculator.CalcService.Interface, Calculator.CalcService.BlockingInterface {

maidsafe-dht.h (http://maidsafe-dht.googlecode.com/svn/trunk/) C Header · 60 lines

52

53 // Generated protocol buffer files

54 #include <maidsafe/protobuf/signed_kadvalue.pb.h>

55 #include <maidsafe/protobuf/kademlia_service_messages.pb.h>

56 #include <maidsafe/protobuf/contact_info.pb.h>

57 #include <maidsafe/protobuf/general_messages.pb.h>

IntermediateInputTest.java (http://appengine-mapreduce.googlecode.com/svn/trunk/) Java · 145 lines

8 import com.google.appengine.api.files.FileServicePb.KeyValues;

9 import com.google.appengine.api.files.RecordReadChannel;

10 import com.google.appengine.repackaged.com.google.protobuf.ByteString;

11 import com.google.appengine.tools.development.testing.LocalFileServiceTestConfig;

12 import com.google.appengine.tools.development.testing.LocalServiceTestHelper;

ValuePair.java (https://code.google.com/p/cap-library/) Java · 521 lines

4

5 public final class ValuePair extends

6 com.google.protobuf.GeneratedMessage

7 implements ValuePairOrBuilder {

8 // Use ValuePair.newBuilder() to construct.

21 }

22

23 public static final com.google.protobuf.Descriptors.Descriptor

24 getDescriptor() {

25 return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_ValuePair_descriptor;

26 }

27

28 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable

29 internalGetFieldAccessorTable() {

30 return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_ValuePair_fieldAccessorTable;

Alert.java (https://code.google.com/p/cap-library/) Java · 2422 lines

4

5 public final class Alert extends

6 com.google.protobuf.GeneratedMessage

7 implements AlertOrBuilder {

8 // Use Alert.newBuilder() to construct.

21 }

22

23 public static final com.google.protobuf.Descriptors.Descriptor

24 getDescriptor() {

25 return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Alert_descriptor;

26 }

27

28 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable

29 internalGetFieldAccessorTable() {

30 return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Alert_fieldAccessorTable;

Circle.java (https://code.google.com/p/cap-library/) Java · 540 lines

4

5 public final class Circle extends

6 com.google.protobuf.GeneratedMessage

7 implements CircleOrBuilder {

8 // Use Circle.newBuilder() to construct.

21 }

22

23 public static final com.google.protobuf.Descriptors.Descriptor

24 getDescriptor() {

25 return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Circle_descriptor;

26 }

27

28 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable

29 internalGetFieldAccessorTable() {

30 return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Circle_fieldAccessorTable;

Info.java (https://code.google.com/p/cap-library/) Java · 3540 lines

4

5 public final class Info extends

6 com.google.protobuf.GeneratedMessage

7 implements InfoOrBuilder {

8 // Use Info.newBuilder() to construct.

21 }

22

23 public static final com.google.protobuf.Descriptors.Descriptor

24 getDescriptor() {

25 return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Info_descriptor;

26 }

27

28 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable

29 internalGetFieldAccessorTable() {

30 return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Info_fieldAccessorTable;

Area.java (https://code.google.com/p/cap-library/) Java · 1381 lines

4

5 public final class Area extends

6 com.google.protobuf.GeneratedMessage

7 implements AreaOrBuilder {

8 // Use Area.newBuilder() to construct.

21 }

22

23 public static final com.google.protobuf.Descriptors.Descriptor

24 getDescriptor() {

25 return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Area_descriptor;

26 }

27

28 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable

29 internalGetFieldAccessorTable() {

30 return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Area_fieldAccessorTable;

Resource.java (https://code.google.com/p/cap-library/) Java · 872 lines

4

5 public final class Resource extends

6 com.google.protobuf.GeneratedMessage

7 implements ResourceOrBuilder {

8 // Use Resource.newBuilder() to construct.

21 }

22

23 public static final com.google.protobuf.Descriptors.Descriptor

24 getDescriptor() {

25 return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Resource_descriptor;

26 }

27

28 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable

29 internalGetFieldAccessorTable() {

30 return com.google.publicalerts.cap.Cap.internal_static_publicalerts_cap_Resource_fieldAccessorTable;

RpcMessage.pb.h (https://code.google.com/p/protobuf-remote/) C Header · 1051 lines ✨ Summary

This C header file defines a protocol buffer (protobuf) message structure for remote procedure calls (RPCs). It includes definitions for RpcMessage and its fields, such as id, call_message, and result_message. The code provides methods for accessing and modifying these fields, allowing developers to serialize and deserialize RPC messages.

81 ::google::protobuf::io::CodedOutputStream* output) const;

82 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

83 int GetCachedSize() const { return _cached_size_; }

84 private:

122 inline ::ProtoBufRemote::RpcMessage_Parameter* add_parameters();

123 inline const ::google::protobuf::RepeatedPtrField< ::ProtoBufRemote::RpcMessage_Parameter >&

124 parameters() const;

125 inline ::google::protobuf::RepeatedPtrField< ::ProtoBufRemote::RpcMessage_Parameter >*

142 ::std::string* method_;

143 static const ::std::string _default_method_;

144 ::google::protobuf::RepeatedPtrField< ::ProtoBufRemote::RpcMessage_Parameter > parameters_;

145 bool expects_result_;

146 friend void protobuf_AddDesc_RpcMessage_2eproto();

207 ::google::protobuf::io::CodedOutputStream* output) const;

208 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

209 int GetCachedSize() const { return _cached_size_; }

210 private:

ParameterConverter.cs (https://code.google.com/p/protobuf-remote/) C# · 386 lines ✨ Summary

This C# code is part of a class that handles serialization and deserialization of data between a client and server, likely in a web application. It provides methods for converting data types such as integers, floats, strings, and protobuf messages to and from the RpcMessage object, which represents a message exchanged between the client and server.

91 else

92 {

93 //check the server returned a protobuf message

94 if (message.ProtoParam != null)

95 {

96 //can't check the protobuf message was the expected type, as protobuf-net is much too lenient, it doesn't

97 //check required fields or care about invalid fields either

98 var memStream = new MemoryStream(message.ProtoParam);

376 }

377

378 //can't check the protobuf message was the expected type, as protobuf-net is much too lenient, it doesn't

379 //check required fields or care about invalid fields either

380 var memStream = new MemoryStream(message.ProtoParam);

ParameterConverterTest.cs (https://code.google.com/p/protobuf-remote/) C# · 371 lines ✨ Summary

This C# code is a unit test suite for a class called ParameterConverter. It tests various methods of the class, including converting between data types and serializing/deserializing objects to/from messages. The tests cover different scenarios, such as null values, primitive types, and custom classes, ensuring that the converter functions correctly in various situations.

2 using System.Linq;

3 using NUnit.Framework;

4 using ProtoBuf;

5

6 namespace ProtoBufRemote.Test

RpcServerTest.cs (https://code.google.com/p/protobuf-remote/) C# · 383 lines ✨ Summary

This C# code is a test class for an RPC (Remote Procedure Call) system, testing various types of parameters and responses. It creates mock RPC messages with different parameter types (e.g., int, string, proto buffer) and verifies that the expected results are returned by the system. The tests ensure that the system handles different scenarios correctly, such as failed requests and successful responses with specific data formats.

7 using NUnit.Framework;

8

9 namespace ProtoBufRemote.Test

10 {

11 [TestFixture]

315

316 var memStream = new MemoryStream();

317 ProtoBuf.Serializer.Serialize(memStream, input);

318

319 testParamCallMessage.CallMessage.Method = "Multiply";

373

374 var memStream = new MemoryStream(message.ResultMessage.CallResult.ProtoParam);

375 MultiplyOutput output = ProtoBuf.Serializer.Deserialize<MultiplyOutput>(memStream);

376 if (output.ResultNumber != 42 || output.ResultString != "Answer is 42")

377 return false;

equal_test.go (https://code.google.com/p/goprotobuf/) Go · 135 lines

2 //

3 // Copyright 2011 Google Inc. All rights reserved.

4 // http://code.google.com/p/goprotobuf/

5 //

6 // Redistribution and use in source and binary forms, with or without

37

38 pb "./testdata"

39 . "code.google.com/p/goprotobuf/proto"

40 )

41

ClientImpl.hpp (http://iocpframework.googlecode.com/svn/trunk/) C++ Header · 138 lines

4

5 #include "../../../../include/Network/TCP.hpp"

6 #include "../ProtoBuf/Dispatcher.hpp"

7 #include "../ProtoBuf/Codec.hpp"

22 std::tr1::array<char, 4096> buf_;

23

24 dispatch::ProtobufDispatcher<Client> dispatcher_;

25 ProtobufCodec<Client> codec_;

30 , socket_(io, network::Tcp::V4())

31 , dispatcher_(std::tr1::bind(&Client::_OnUnknownMessage, this, _1, _2))

32 , codec_(std::tr1::bind(&dispatch::ProtobufDispatcher<Client>::OnProtobufMessage, &dispatcher_, _1, _2))

33 {

34 using namespace std::tr1::placeholders;

AbstractBenchmarkServer.java (http://nfs-rpc.googlecode.com/svn/trunk/) Java · 81 lines

21 import code.google.nfs.rpc.server.ServerProcessor;

22

23 import com.google.protobuf.ByteString;

24

25

CMakeLists.txt (http://protobuf-c.googlecode.com/svn/trunk/) CMake · 119 lines

46 add_definitions(-DHAVE_PROTOBUF_C_CONFIG_H=1)

47 configure_file(google/protobuf-c/protobuf-c-config.h.in

48 google/protobuf-c/protobuf-c-config.h)

99 endif()

100

101 if ( BUILD_PROTOBUF_C_STATIC_LIB OR BUILD_PROTOBUF_C_SHARED_LIB )

102 if ( WIN32 )

103 set(PROTOBUF_C_PUBLIC_HEADERS

104 google/protobuf-c/protobuf-c.h

105 google/protobuf-c/protobuf-c-private.h)

106 else()

107 set(PROTOBUF_C_PUBLIC_HEADERS

108 google/protobuf-c/protobuf-c.h

109 google/protobuf-c/protobuf-c-private.h

110 google/protobuf-c/protobuf-c-dispatch.h

111 google/protobuf-c/protobuf-c-rpc.h)

112 endif()

113 install(FILES ${PROTOBUF_C_PUBLIC_HEADERS} DESTINATION

StreamRpcChannel.h (https://code.google.com/p/linux-lighting/) C Header · 159 lines

23

24 #include <stdint.h>

25 #include <google/protobuf/service.h>

26 #include <ola/Callback.h>

27 #include <ola/io/Descriptor.h>

34 namespace rpc {

35

36 using google::protobuf::Message;

37 using google::protobuf::MethodDescriptor;

38 using google::protobuf::RpcChannel;

39 using google::protobuf::RpcController;

73 /*

74 * The first 4 bytes are the header which contains the RPC protocol version

75 * (this is separate from the protobuf version) and the size of the protobuf.

76 */

77 public:

java_enum.h (http://protobuf.googlecode.com/svn/trunk/) C Header · 87 lines

1 // Protocol Buffers - Google's data interchange format

2 // Copyright 2008 Google Inc. All rights reserved.

3 // http://code.google.com/p/protobuf/

4 //

5 // Redistribution and use in source and binary forms, with or without

33 // Sanjay Ghemawat, Jeff Dean, and others.

34

35 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_H__

36 #define GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_H__

38 #include <string>

39 #include <vector>

40 #include <google/protobuf/descriptor.h>

41

42 namespace google {

43 namespace protobuf {

44 namespace io {

45 class Printer; // printer.h

GraphCreatorProtos.java (http://mapsforge.googlecode.com/svn/trunk/) Java · 0 lines ✨ Summary

This is a generated Java class for a Protocol Buffer message. It defines a data structure to represent graph creation data, including repeated fields for edges and relations. The class provides methods for adding, removing, and accessing these fields, as well as building and clearing the entire message. It’s likely used in a larger application that serializes and deserializes this data format.

9

10 public static void registerAllExtensions(

11 com.google.protobuf.ExtensionRegistry registry) {

12 }

13

14 public interface GeoCoordinatePBFOrBuilder

15 extends com.google.protobuf.MessageOrBuilder {

16

17 // required double latitude = 1;

27

28 public static final class GeoCoordinatePBF extends

29 com.google.protobuf.GeneratedMessage

30 implements GeoCoordinatePBFOrBuilder {

31 // Use GeoCoordinatePBF.newBuilder() to construct.

TungstenProtos.java (http://tungsten-replicator.googlecode.com/svn/trunk/) Java · 7305 lines ✨ Summary

This is a generated Java class that represents a protocol buffer file. It defines a set of message classes and their corresponding fields, which are used to serialize and deserialize data in a specific format. The code is automatically generated by the Protocol Buffers compiler and provides a way to work with the defined messages in Java.

28 public static final com.google.protobuf.Descriptors.Descriptor

29 getDescriptor() {

30 return com.continuent.tungsten.replicator.thl.protobuf.TungstenProtos.internal_static_TungstenProtobuf_Header_descriptor;

31 }

32

760 public static final com.google.protobuf.Descriptors.Descriptor

761 getDescriptor() {

762 return com.continuent.tungsten.replicator.thl.protobuf.TungstenProtos.internal_static_TungstenProtobuf_ProtobufOneRowChange_descriptor;

763 }

764

765 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable

766 internalGetFieldAccessorTable() {

767 return com.continuent.tungsten.replicator.thl.protobuf.TungstenProtos.internal_static_TungstenProtobuf_ProtobufOneRowChange_fieldAccessorTable;

768 }

769

scala_message.cc (http://protobuf-scala.googlecode.com/svn/trunk/) C++ · 138 lines

16 #include <string>

17

18 #include <google/protobuf/compiler/java/java_helpers.h>

19 #include <org/matmexrhino/protobuf/scala/scala_message.h>

21 using std::map;

22 using std::string;

23 using namespace google::protobuf::compiler::java;

24 using google::protobuf::FieldDescriptor;

33 case JAVATYPE_BOOLEAN: return box ? "java.lang.Boolean" : "scala.Boolean";

34 case JAVATYPE_STRING: return "java.lang.String";

35 case JAVATYPE_BYTES: return "com.google.protobuf.ByteString";

36 case JAVATYPE_ENUM: return ClassName(descriptor->enum_type());

37 case JAVATYPE_MESSAGE: return ClassName(descriptor->message_type()) + ".Builder";

51 namespace org {

52 namespace matmexrhino {

53 namespace protobuf {

54 namespace scala {

55

websocket_service_pb2.py (https://code.google.com/p/typhoonae/) Python · 244 lines

1 # Generated by the protocol buffer compiler. DO NOT EDIT!

2

3 from google.protobuf import descriptor

4 from google.protobuf import message

5 from google.protobuf import reflection

6 from google.protobuf import service

7 from google.protobuf import service_reflection

8 from google.protobuf import descriptor_pb2

conversion.go (https://code.google.com/p/appengine-go/) Go · 119 lines

18 "appengine"

19 "appengine_internal"

20 "code.google.com/p/goprotobuf/proto"

21

22 conversion_proto "appengine_internal/conversion"

Service.java (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) Java · 118 lines

1 // Protocol Buffers - Google's data interchange format

2 // Copyright 2008 Google Inc. All rights reserved.

3 // http://code.google.com/p/protobuf/

4 //

5 // Redistribution and use in source and binary forms, with or without

29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

30

31 package com.google.protobuf;

32

33 /**

ShuffleServiceImpl.java (http://appengine-mapreduce.googlecode.com/svn/trunk/) Java · 118 lines

13 import com.google.appengine.api.files.FileServicePb.ShuffleOutputSpecification;

14 import com.google.appengine.api.files.FileServicePb.ShuffleRequest;

15 import com.google.appengine.repackaged.com.google.protobuf.InvalidProtocolBufferException;

16 import com.google.appengine.tools.mapreduce.impl.util.SerializationUtil;

17 import com.google.apphosting.api.ApiProxy;

100 }

101

102 // TODO(ohler): Don't use protobuf return type

103 @Override

104 public GetShuffleStatusResponse getStatus(String shuffleId) {

CommonNamesProto.java (http://ala-bie.googlecode.com/svn/trunk/) Java · 861 lines

7 private CommonNamesProto() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public static final class CommonNames extends

12 com.google.protobuf.GeneratedMessage {

13 // Use CommonNames.newBuilder() to construct.

14 private CommonNames() {

26 }

27

28 public static final com.google.protobuf.Descriptors.Descriptor

29 getDescriptor() {

30 return org.ala.io.CommonNamesProto.internal_static_CommonNames_descriptor;

decs.pb.h (http://decs.googlecode.com/svn/trunk/) C Header · 1587 lines

116 ::google::protobuf::io::CodedOutputStream* output) const;

117 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

118 int GetCachedSize() const { return _cached_size_; }

119 private:

437 ::google::protobuf::io::CodedOutputStream* output) const;

438 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

439 int GetCachedSize() const { return _cached_size_; }

440 private:

457 inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& element() const;

458 inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* mutable_element();

459 inline ::google::protobuf::uint32 element(int index) const;

465 mutable int _cached_size_;

466

467 ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > element_;

468 friend void protobuf_AddDesc_decs_2eproto();

descriptor.pb.cc (http://decs.googlecode.com/svn/trunk/) C++ · 6378 lines

1 // Generated by the protocol buffer compiler. DO NOT EDIT!

2

3 #include "google/protobuf/descriptor.pb.h"

4 #include <google/protobuf/stubs/once.h>

5 #include <google/protobuf/descriptor.h>

6 #include <google/protobuf/io/coded_stream.h>

7 #include <google/protobuf/reflection_ops.h>

8 #include <google/protobuf/wire_format_inl.h>

9

10 namespace google {

11 namespace protobuf {

12

13 namespace {

75

76

77 void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto() {

78 protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto();

capability_service.pb.go (https://code.google.com/p/appengine-go/) Go · 125 lines

4 package appengine

5

6 import proto "code.google.com/p/goprotobuf/proto"

7 import "math"

8

75

76 type CapabilityConfigList struct {

77 Config []*CapabilityConfig `protobuf:"bytes,1,rep,name=config" json:"config,omitempty"`

78 DefaultConfig *CapabilityConfig `protobuf:"bytes,2,opt,name=default_config" json:"default_config,omitempty"`

84

85 type CapabilityConfig struct {

86 Package *string `protobuf:"bytes,1,req,name=package" json:"package,omitempty"`

87 Capability *string `protobuf:"bytes,2,req,name=capability" json:"capability,omitempty"`

88 Status *CapabilityConfig_Status `protobuf:"varint,3,opt,name=status,enum=appengine.CapabilityConfig_Status,def=4" json:"status,omitempty"`

89 ScheduledTime *string `protobuf:"bytes,7,opt,name=scheduled_time" json:"scheduled_time,omitempty"`

key_test.py (https://code.google.com/p/webapp-improved/) Python · 0 lines

196 key.Key(serialized=serialized.decode('utf8'))

197 key.Key(reference=r)

198 # TODO: this may not make sense -- the protobuf utf8-encodes values

199 r = entity_pb.Reference()

200 r.set_app('_')

ServiceMethodMovement.java (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) Java · 120 lines

7 private ServiceMethodMovement() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public enum MethodMovement

12 implements com.google.protobuf.ProtocolMessageEnum {

13 WORLD_INFO(0, 1),

14 USERS_ADD(1, 2),

38 }

39

40 public static com.google.protobuf.Internal.EnumLiteMap<MethodMovement>

41 internalGetValueMap() {

42 return internalValueMap;

c_primitive_field.cc (http://protobuf-c.googlecode.com/svn/trunk/) C++ · 169 lines

1 // Protocol Buffers - Google's data interchange format

2 // Copyright 2008 Google Inc.

3 // http://code.google.com/p/protobuf/

4 //

5 // Licensed under the Apache License, Version 2.0 (the "License");

21 // Modified to implement C code by Dave Benson.

22

23 #include <google/protobuf/compiler/c/c_primitive_field.h>

24 #include <google/protobuf/compiler/c/c_helpers.h>

25 #include <google/protobuf/io/printer.h>

26 #include <google/protobuf/wire_format.h>

27

28 namespace google {

29 namespace protobuf {

30 namespace compiler {

31 namespace c {

enum_pb.erl (http://erlang-lab.googlecode.com/svn/trunk/) Erlang · 149 lines

39 [pack(FNum, optional, Head, Type, []) | Acc]);

40 pack(FNum, repeated_packed, Data, Type, _) ->

41 protobuffs:encode_packed(FNum, Data, Type);

42 pack(FNum, _, Data, _, _) when is_tuple(Data) ->

43 [RecName | _] = tuple_to_list(Data),

44 protobuffs:encode(FNum, encode(RecName, Data), bytes);

45 pack(FNum, _, Data, Type, _)

46 when Type =:= bool;

59 Type =:= float;

60 Type =:= double ->

61 protobuffs:encode(FNum, Data, Type);

62 pack(FNum, _, Data, Type, _) when is_atom(Data) ->

63 protobuffs:encode(FNum, enum_to_int(Type, Data), enum).

test-private.scm (http://r6rs-protobuf.googlecode.com/svn/trunk/) Scheme · 133 lines

1 ;; test-private.scm: private API test routines for r6rs-protobuf

2 ;; Copyright (C) 2011 Julian Graham

3

4 ;; r6rs-protobuf is free software: you can redistribute it and/or modify

5 ;; it under the terms of the GNU General Public License as published by

6 ;; the Free Software Foundation, either version 3 of the License, or

18

19 (import (rnrs))

20 (import (protobuf private))

21 (import (srfi :64))

22

25

26 (define-record-type read-test-message

27 (fields foo) (opaque #t) (parent protobuf:message) (sealed #t))

28

29 (define-record-type read-test-message-builder

Program.cs (https://code.google.com/p/protobuf-remote/) C# · 53 lines ✨ Summary

This C# program creates a client that connects to a remote server on port 13000 and tests whether input numbers are prime using either synchronous or asynchronous queries, depending on the counter value. The results are then printed to the console, displaying “Prime!” if the number is prime or “Not prime!”.

4 using System.Net.Sockets;

5 using System.Text;

6 using ProtoBufRemote;

7

8 namespace PrimeClient

analysis_pb2.py (https://code.google.com/p/grr/) Python · 212 lines

1 # Generated by the protocol buffer compiler. DO NOT EDIT!

2

3 from google.protobuf import descriptor

4 from google.protobuf import message

5 from google.protobuf import reflection

6 from google.protobuf import descriptor_pb2

ProtocolBuffersTest.java (https://code.google.com/p/google-http-java-client/) Java · 45 lines

13 */

14

15 package com.google.api.client.protobuf;

16

17 import junit.framework.TestCase;

a.h (http://d-protobuf.googlecode.com/svn/trunk/) C Header · 311 lines

8 #include <google/protobuf/stubs/common.h>

9

10 #if GOOGLE_PROTOBUF_VERSION < 2000003

11 #error This file was generated by a newer version of protoc which is

12 #error incompatible with your Protocol Buffer headers. Please update

67 const ::google::protobuf::Descriptor* GetDescriptor() const;

68 const ::google::protobuf::Reflection* GetReflection() const;

69

70 // nested types ----------------------------------------------------

119 }

120

121 inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {

122 return _unknown_fields_;

123 }

257 extern ::google::protobuf::internal::ExtensionIdentifier< ::Foo,

258 ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 > > bar;

259

260 // ===================================================================

ProtoBufsTest.java (http://ala-bie.googlecode.com/svn/trunk/) Java · 86 lines

27 * @author Dave Martin (David.Martin@csiro.au)

28 */

29 public class ProtoBufsTest extends TestCase {

30

31 public void testCommonName() throws Exception {

60 commonNames.writeTo(fOut);

61

62 //read the protobufs from file

63 FileInputStream fIn = new FileInputStream(tmpFile);

64 CommonNamesProto.CommonNames deserialisedCommonNames = CommonNamesProto.CommonNames.parseFrom(fIn);

java_string_field.h (http://protobuf.googlecode.com/svn/trunk/) C Header · 123 lines

1 // Protocol Buffers - Google's data interchange format

2 // Copyright 2008 Google Inc. All rights reserved.

3 // http://code.google.com/p/protobuf/

4 //

5 // Redistribution and use in source and binary forms, with or without

34 // Sanjay Ghemawat, Jeff Dean, and others.

35

36 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_H__

37 #define GOOGLE_PROTOBUF_COMPILER_JAVA_STRING_FIELD_H__

39 #include <map>

40 #include <string>

41 #include <google/protobuf/compiler/java/java_field.h>

42

43 namespace google {

44 namespace protobuf {

45 namespace compiler {

46 namespace java {

ServersServiceImpl.java (http://googleappengine.googlecode.com/svn/trunk/) Java · 192 lines

22 import com.google.common.base.Splitter;

23 import com.google.common.collect.Sets;

24 import com.google.protobuf.InvalidProtocolBufferException;

25 import com.google.protobuf.Message;

once.cc (http://decs.googlecode.com/svn/trunk/) C++ · 83 lines

1 // Protocol Buffers - Google's data interchange format

2 // Copyright 2008 Google Inc. All rights reserved.

3 // http://code.google.com/p/protobuf/

4 //

5 // Redistribution and use in source and binary forms, with or without

40 #endif

41

42 #include <google/protobuf/stubs/once.h>

43

44 namespace google {

45 namespace protobuf {

46

47 #ifdef _WIN32

UnitInfoContainer.cs (http://hfm-net.googlecode.com/svn/trunk/) C# · 0 lines

23 using System.IO;

24

25 using ProtoBuf;

26

27 using HFM.Framework;

ProtoBufUtil.cs (https://code.google.com/p/lokad-shared-libraries/) C# · 0 lines

4 using System.Text;

5 using System.Xml.Serialization;

6 using ProtoBuf;

7

8 namespace Lokad.Serialization

9 {

10 public static class ProtoBufUtil

11 {

12 public static string GetContractReference(Type type)

42 catch (TargetInvocationException tie)

43 {

44 var message = string.Format("Failed to prepare ProtoBuf serializer for '{0}'.", type);

45 throw new InvalidOperationException(message, tie.InnerException);

46 }

java_primitive_field.h (http://protobuf.googlecode.com/svn/trunk/) C Header · 124 lines

1 // Protocol Buffers - Google's data interchange format

2 // Copyright 2008 Google Inc. All rights reserved.

3 // http://code.google.com/p/protobuf/

4 //

5 // Redistribution and use in source and binary forms, with or without

33 // Sanjay Ghemawat, Jeff Dean, and others.

34

35 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_PRIMITIVE_FIELD_H__

36 #define GOOGLE_PROTOBUF_COMPILER_JAVA_PRIMITIVE_FIELD_H__

38 #include <map>

39 #include <string>

40 #include <google/protobuf/compiler/java/java_field.h>

41

42 namespace google {

43 namespace protobuf {

44 namespace compiler {

45 namespace java {

test.pb.go (https://code.google.com/p/goprotobuf/) Go · 242 lines

4 package my_test

5

6 import proto "code.google.com/p/goprotobuf/proto"

7 import "math"

8

116

117 type Request struct {

118 Key []int64 `protobuf:"varint,1,rep,name=key" json:"key,omitempty"`

119 Hue *Request_Color `protobuf:"varint,3,opt,name=hue,enum=my.test.Request_Color" json:"hue,omitempty"`

120 Hat *HatType `protobuf:"varint,4,opt,name=hat,enum=my.test.HatType,def=1" json:"hat,omitempty"`

121 Deadline *float32 `protobuf:"fixed32,7,opt,name=deadline,def=inf" json:"deadline,omitempty"`

122 Somegroup *Request_SomeGroup `protobuf:"group,8,opt,name=SomeGroup" json:"somegroup,omitempty"`

123 Reset_ *int32 `protobuf:"varint,12,opt,name=reset" json:"reset,omitempty"`

ProtoClasses.java (http://findbugs.googlecode.com/svn/trunk/) Java · 5499 lines

28 public static final com.google.protobuf.Descriptors.Descriptor

29 getDescriptor() {

30 return edu.umd.cs.findbugs.cloud.appEngine.protobuf.ProtoClasses.internal_static_edu_umd_cs_findbugs_cloud_appEngine_protobuf_LogIn_descriptor;

31 }

32

33 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable

34 internalGetFieldAccessorTable() {

35 return edu.umd.cs.findbugs.cloud.appEngine.protobuf.ProtoClasses.internal_static_edu_umd_cs_findbugs_cloud_appEngine_protobuf_LogIn_fieldAccessorTable;

36 }

37

353 public static final com.google.protobuf.Descriptors.Descriptor

354 getDescriptor() {

355 return edu.umd.cs.findbugs.cloud.appEngine.protobuf.ProtoClasses.internal_static_edu_umd_cs_findbugs_cloud_appEngine_protobuf_VersionInfo_descriptor;

356 }

357

Market.java (http://android-market-api.googlecode.com/svn/trunk/) Java · 18667 lines

7 private Market() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public enum AppType

12 implements com.google.protobuf.ProtocolMessageEnum {

13 NONE(0, 0),

14 APPLICATION(1, 1),

38 }

39

40 public static com.google.protobuf.Internal.EnumLiteMap<AppType>

41 internalGetValueMap() {

42 return internalValueMap;

RpcMethodDescriptor.cs (https://code.google.com/p/protobuf-remote/) C# · 188 lines ✨ Summary

This C# code defines a class RpcMethodDescriptor that represents a remote procedure call (RPC) method. It validates and stores information about the method’s parameters, return type, and asynchronous declarations. The class provides methods to invoke the RPC method on a service, handling parameter conversions and result message creation.

5 using System.Linq;

6

7 namespace ProtoBufRemote

8 {

9 internal class RpcMethodDescriptor

OsmandOdb.java (https://code.google.com/p/osmand/) Java · 14258 lines

7 private OsmandOdb() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public static final class OsmAndStructure extends

12 com.google.protobuf.GeneratedMessage {

13 // Use OsmAndStructure.newBuilder() to construct.

14 private OsmAndStructure() {

27 }

28

29 public static final com.google.protobuf.Descriptors.Descriptor

30 getDescriptor() {

31 return net.osmand.binary.OsmandOdb.internal_static_OsmAndStructure_descriptor;

protobuf-c-private.h (http://protobuf-c.googlecode.com/svn/trunk/) C Header · 107 lines

52 /* === needs to be declared for the PROTOBUF_C_BUFFER_SIMPLE_INIT macro === */

53

54 void protobuf_c_buffer_simple_append (ProtobufCBuffer *buffer,

55 size_t len,

56 const unsigned char *data);

90 #define PROTOBUF_C_SERVICE_DESCRIPTOR_MAGIC 0x14159bc3

91 #define PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC 0x28aaeef9

92 #define PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC 0x114315af

95 typedef void (*ProtobufCServiceDestroy) (ProtobufCService *service);

96 void

97 protobuf_c_service_generated_init (ProtobufCService *service,

98 const ProtobufCServiceDescriptor *descriptor,

100

101 void

102 protobuf_c_service_invoke_internal(ProtobufCService *service,

103 unsigned method_index,

104 const ProtobufCMessage *input,

SocketRpcConnectionFactoryTest.java (http://protobuf-socket-rpc.googlecode.com/svn/trunk/) Java · 113 lines

19 // THE SOFTWARE.

20

21 package com.googlecode.protobuf.socketrpc;

22

23 import java.io.ByteArrayInputStream;

26 import java.net.UnknownHostException;

27

28 import com.googlecode.protobuf.socketrpc.RpcConnectionFactory.Connection;

29 import com.googlecode.protobuf.socketrpc.TestProtos.Request;

30 import com.googlecode.protobuf.socketrpc.TestProtos.Request.Builder;

31

32 import junit.framework.TestCase;

runscript.sh (http://fxbattle.googlecode.com/svn/trunk/) Shell · 24 lines

1 cd target/classes

2 # first attempt at running script using just java.

3 # java -cp /Users/spina/Code/FxJava/fxbattle/launcher/target/classes:/Users/spina/.m2/m2_repo/edu/stsci/CoSI/17.5rc1/CoSI-17.5rc1.jar:/Users/spina/.m2/m2_repo/com/google/protobuf/protobuf-java/2.1.0/protobuf-java-2.1.0.jar:/Users/spina/.m2/m2_repo/org/clojure/clojure/1.0.0/clojure-1.0.0.jar:/Users/spina/.m2/m2_repo/fxbattle/servermodel/1.0-SNAPSHOT/servermodel-1.0-SNAPSHOT.jar:/Users/spina/.m2/m2_repo/fxbattle/protos/1.0-SNAPSHOT/protos-1.0-SNAPSHOT.jar:/Users/spina/.m2/m2_repo/fxbattle/fxgui/1.0-SNAPSHOT/fxgui-1.0-SNAPSHOT.jar:/Users/spina/.m2/m2_repo/fxbattle/clientmodel/1.0-SNAPSHOT/clientmodel-1.0-SNAPSHOT.jar:/Users/spina/.m2/m2_repo/fxbattle/socketcoms/1.0-SNAPSHOT/socketcoms-1.0-SNAPSHOT.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/shared/javafxrt.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/shared/javafxc.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/desktop/rt15.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/desktop/javafx-geom.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/desktop/javafx-ui-common.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/desktop/javafx-ui-desktop.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/desktop/javafx-ui-swing.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/desktop/fxdloader.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/desktop/websvc.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/desktop/javafx-ui-controls.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/desktop/javafx-ui-charts.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/desktop/javafx-common.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/desktop/javafx-io.jar:/Library/Frameworks/JavaFX.framework/Versions/Current/lib/desktop/script-api.jar fxbattle.launcher.JavaLaunchStub

4

5 # runs the script using javafx script.

6 javafx -cp /Users/spina/Code/FxJava/fxbattle/launcher/target/classes:/Users/spina/.m2/m2_repo/edu/stsci/CoSI/17.5rc1/CoSI-17.5rc1.jar:/Users/spina/.m2/m2_repo/com/google/protobuf/protobuf-java/2.1.0/protobuf-java-2.1.0.jar:/Users/spina/.m2/m2_repo/org/clojure/clojure/1.0.0/clojure-1.0.0.jar:/Users/spina/Code/FxJava/fxbattle/servermodel/target/classes:/Users/spina/Code/FxJava/fxbattle/protos/target/protos-1.0-SNAPSHOT.jar:/Users/spina/Code/FxJava/fxbattle/fxgui/target/classes:/Users/spina/Code/FxJava/fxbattle/clientmodel/target/clientmodel-1.0-SNAPSHOT.jar:/Users/spina/Code/FxJava/fxbattle/socketcoms/target/socketcoms-1.0-SNAPSHOT.jar fxbattle.launcher.FxBattleLauncher

7

8 # runs script using modified version of javafx script-- should have some friendly output...

9 #/Users/spina/Desktop/Fx1.2/bin/javafx -cp /Users/spina/Code/FxJava/fxbattle/launcher/target/classes:/Users/spina/.m2/m2_repo/edu/stsci/CoSI/17.5rc1/CoSI-17.5rc1.jar:/Users/spina/.m2/m2_repo/com/google/protobuf/protobuf-java/2.1.0/protobuf-java-2.1.0.jar:/Users/spina/.m2/m2_repo/org/clojure/clojure/1.0.0/clojure-1.0.0.jar:/Users/spina/Code/FxJava/fxbattle/servermodel/target/classes:/Users/spina/Code/FxJava/fxbattle/protos/target/protos-1.0-SNAPSHOT.jar:/Users/spina/Code/FxJava/fxbattle/fxgui/target/classes:/Users/spina/Code/FxJava/fxbattle/clientmodel/target/clientmodel-1.0-SNAPSHOT.jar:/Users/spina/Code/FxJava/fxbattle/socketcoms/target/socketcoms-1.0-SNAPSHOT.jar fxbattle.launcher.FxBattleLauncher

10

11 # second attempt which actually does (hopefully) execute through Java directly...

FakeSocketFactory.java (http://protobuf-socket-rpc.googlecode.com/svn/trunk/) Java · 89 lines

19 // THE SOFTWARE.

20

21 package com.googlecode.protobuf.socketrpc;

22

23 import java.io.IOException;

ProtostuffNumericJsonSerializer.java (http://thrift-protobuf-compare.googlecode.com/svn/trunk/) Java · 85 lines

5 import org.codehaus.jackson.JsonParser;

6

7 import serializers.protobuf.MediaContentHolder.Image;

8 import serializers.protobuf.MediaContentHolder.Media;

9 import serializers.protobuf.MediaContentHolder.MediaContent;

10 import serializers.protobuf.MediaContentHolder.Image.Size;

11 import serializers.protobuf.MediaContentHolder.Media.Player;

12 import serializers.protostuff.MediaContentHolderNumericJSON;

13

conversion_service.pb.go (https://code.google.com/p/appengine-go/) Go · 127 lines

4 package appengine

5

6 import proto "code.google.com/p/goprotobuf/proto"

7 import "math"

8

61

62 type AssetInfo struct {

63 Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`

64 Data []byte `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"`

65 MimeType *string `protobuf:"bytes,3,opt,name=mime_type" json:"mime_type,omitempty"`

66 XXX_unrecognized []byte `json:"-"`

67 }

71

72 type DocumentInfo struct {

73 Asset []*AssetInfo `protobuf:"bytes,1,rep,name=asset" json:"asset,omitempty"`

74 XXX_unrecognized []byte `json:"-"`

75 }

CallTest.java (http://flex-mmorpg-server.googlecode.com/svn/trunk/) Java · 122 lines

23 import com.glu.rpc.test.TestProto.User;

24 import com.glu.rpc.test.TestProto.TestService.Stub;

25 import com.google.protobuf.RpcCallback;

26 import com.google.protobuf.RpcController;

27 import com.google.protobuf.Service;

28

29 /**

xmpp_service.pb.go (https://code.google.com/p/appengine-go/) Go · 203 lines

4 package appengine

5

6 import proto "code.google.com/p/goprotobuf/proto"

7 import "math"

8

121

122 type PresenceRequest struct {

123 Jid *string `protobuf:"bytes,1,req,name=jid" json:"jid,omitempty"`

124 FromJid *string `protobuf:"bytes,2,opt,name=from_jid" json:"from_jid,omitempty"`

130

131 type PresenceResponse struct {

132 IsAvailable *bool `protobuf:"varint,1,req,name=is_available" json:"is_available,omitempty"`

133 Presence *PresenceResponse_SHOW `protobuf:"varint,2,opt,name=presence,enum=appengine.PresenceResponse_SHOW" json:"presence,omitempty"`

139

140 type XmppMessageRequest struct {

141 Jid []string `protobuf:"bytes,1,rep,name=jid" json:"jid,omitempty"`

142 Body *string `protobuf:"bytes,2,req,name=body" json:"body,omitempty"`

ServiceMethodLogin.java (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) Java · 106 lines

7 private ServiceMethodLogin() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public enum MethodLogin

12 implements com.google.protobuf.ProtocolMessageEnum {

13 LOGIN(0, 1),

14 ;

26 }

27

28 public static com.google.protobuf.Internal.EnumLiteMap<MethodLogin>

29 internalGetValueMap() {

30 return internalValueMap;

IntegrationTest.java (http://protobuf-socket-rpc.googlecode.com/svn/trunk/) Java · 161 lines

19 // THE SOFTWARE.

20

21 package com.googlecode.protobuf.socketrpc;

22

23 import java.io.Closeable;

26 import java.util.concurrent.Executors;

27

28 import com.google.protobuf.BlockingRpcChannel;

29 import com.google.protobuf.RpcCallback;

30 import com.google.protobuf.RpcChannel;

31 import com.google.protobuf.ServiceException;

32 import com.googlecode.protobuf.socketrpc.TestProtos.Request;

33 import com.googlecode.protobuf.socketrpc.TestProtos.Response;

AddressBookProtos.java (http://javawing.googlecode.com/svn/trunk/) Java · 1229 lines

6 private AddressBookProtos() {}

7 public static void registerAllExtensions(

8 com.google.protobuf.ExtensionRegistry registry) {

9 }

10 public static final class Person extends

11 com.google.protobuf.GeneratedMessage {

12 // Use Person.newBuilder() to construct.

13 private Person() {}

22 }

23

24 public static final com.google.protobuf.Descriptors.Descriptor

25 getDescriptor() {

26 return com.example.tutorial.AddressBookProtos.internal_static_tutorial_Person_descriptor;

TwitClient.java (https://code.google.com/p/synoptic/) Java · 154 lines

4 import java.util.Map.Entry;

5

6 import com.google.protobuf.Descriptors.FieldDescriptor;

7

8 import Tracer;

ServerConnector.as (http://mmorpg-client-server-learning.googlecode.com/svn/trunk/) ActionScript · 194 lines

10 import com.jediflasher.game_client.utils.logging.LoggerEvent;

11 import com.jediflasher.game_client.utils.logging.LoggerMessageLevel;

12 import com.netease.protobuf.Message;

13

14 import flash.events.Event;

TestProto.java (http://flex-mmorpg-server.googlecode.com/svn/trunk/) Java · 914 lines

8

9 public static void registerAllExtensions(

10 com.google.protobuf.ExtensionRegistry registry) {

11 }

12

253 com.google.protobuf.ExtensionRegistry extensionRegistry)

254 throws java.io.IOException {

255 com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet

256 .newBuilder(this.getUnknownFields());

257 while (true) {

573 com.google.protobuf.ExtensionRegistry extensionRegistry)

574 throws java.io.IOException {

575 com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet

576 .newBuilder(this.getUnknownFields());

577 while (true) {

759 com.google.protobuf.Message request,

760 com.google.protobuf.RpcCallback<com.google.protobuf.Message> done) {

761 if (method.getService() != getDescriptor()) {

762 throw new java.lang.IllegalArgumentException(

LoginServiceProto.java (http://flex-mmorpg-server.googlecode.com/svn/trunk/) Java · 545 lines

3 package com.glu.rpc.service;

4

5 import com.google.protobuf.UninitializedMessageException;

6

7 public final class LoginServiceProto {

8 private LoginServiceProto() {}

9 public static void registerAllExtensions(

10 com.google.protobuf.ExtensionRegistry registry) {

11 }

12 public static final class LoginResult extends

13 com.google.protobuf.GeneratedMessage {

14 // Use LoginResult.newBuilder() to construct.

15 private LoginResult() {}

RpcProtobuf.java (http://flex-mmorpg-server.googlecode.com/svn/trunk/) Java · 890 lines

112 public static final int REQUEST_PROTO_FIELD_NUMBER = 3;

113 private boolean hasRequestProto;

114 private com.google.protobuf.ByteString requestProto_ = com.google.protobuf.ByteString.EMPTY;

115 public boolean hasRequestProto() { return hasRequestProto; }

116 public com.google.protobuf.ByteString getRequestProto() { return requestProto_; }

454 public static final int RESPONSE_PROTO_FIELD_NUMBER = 1;

455 private boolean hasResponseProto;

456 private com.google.protobuf.ByteString responseProto_ = com.google.protobuf.ByteString.EMPTY;

457 public boolean hasResponseProto() { return hasResponseProto; }

458 public com.google.protobuf.ByteString getResponseProto() { return responseProto_; }

475 public static final int ERROR_REASON_FIELD_NUMBER = 4;

476 private boolean hasErrorReason;

477 private com.glu.rpc.service.RpcProtobuf.ErrorReason errorReason_ = com.glu.rpc.service.RpcProtobuf.ErrorReason.BAD_REQUEST_PROTO;

478 public boolean hasErrorReason() { return hasErrorReason; }

479 public com.glu.rpc.service.RpcProtobuf.ErrorReason getErrorReason() { return errorReason_; }

RegisteServiceProto.java (http://flex-mmorpg-server.googlecode.com/svn/trunk/) Java · 717 lines

3 package com.glu.rpc.service;

4

5 import com.google.protobuf.UninitializedMessageException;

6

7 public final class RegisteServiceProto {

8 private RegisteServiceProto() {}

9 public static void registerAllExtensions(

10 com.google.protobuf.ExtensionRegistry registry) {

11 }

12 public enum FailureCause

13 implements com.google.protobuf.ProtocolMessageEnum {

14 DUPLICATE_USERNAME(0, 0),

15 REGISTER_RPC_FAILED(1, 1),

test.pb.h (http://iocpframework.googlecode.com/svn/trunk/) C Header · 721 lines

2 // source: test.proto

3

4 #ifndef PROTOBUF_test_2eproto__INCLUDED

5 #define PROTOBUF_test_2eproto__INCLUDED

80 ::google::protobuf::io::CodedOutputStream* output) const;

81 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

82 int GetCachedSize() const { return _cached_size_; }

83 private:

193 ::google::protobuf::io::CodedOutputStream* output) const;

194 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

195 int GetCachedSize() const { return _cached_size_; }

196 private:

320 ::google::protobuf::io::CodedOutputStream* output) const;

321 ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;

322 int GetCachedSize() const { return _cached_size_; }

323 private:

PB.java (http://nfs-rpc.googlecode.com/svn/trunk/) Java · 765 lines

7 private PB() {}

8 public static void registerAllExtensions(

9 com.google.protobuf.ExtensionRegistry registry) {

10 }

11 public interface RequestObjectOrBuilder

324

325 // required bytes bytesObject = 1;

326 private com.google.protobuf.ByteString bytesObject_ = com.google.protobuf.ByteString.EMPTY;

327 public boolean hasBytesObject() {

328 return ((bitField0_ & 0x00000001) == 0x00000001);

673

674 // required bytes bytesObject = 1;

675 private com.google.protobuf.ByteString bytesObject_ = com.google.protobuf.ByteString.EMPTY;

676 public boolean hasBytesObject() {

677 return ((bitField0_ & 0x00000001) == 0x00000001);