protogen

Protogen generate List<int> instead of int array

ぃ、小莉子 提交于 2021-02-10 16:51:46
问题 Protogen (langver=3) compiles repeated int32 someInt; To a int[] . Is there any way to force it to compile to System.Collections.Generic.List<int> ? Most other types (string, or custom types) compile to list. I can implement a workaround, but the cleanest solution for me would be if this could unpack my buffer to a List<int> 回答1: Right now: no, not without editing some C#. I have on my list adding the ability to choose list/lookup types for a range of reasons including this. I'll try to make

Protogen generate List<int> instead of int array

这一生的挚爱 提交于 2021-02-10 16:50:58
问题 Protogen (langver=3) compiles repeated int32 someInt; To a int[] . Is there any way to force it to compile to System.Collections.Generic.List<int> ? Most other types (string, or custom types) compile to list. I can implement a workaround, but the cleanest solution for me would be if this could unpack my buffer to a List<int> 回答1: Right now: no, not without editing some C#. I have on my list adding the ability to choose list/lookup types for a range of reasons including this. I'll try to make

Protogen Vs. Protoc Compiler Options

有些话、适合烂在心里 提交于 2020-01-11 10:57:06
问题 I have some .proto files used to compile classes from Java, C++ and C#. For Java and C++ I use the Protoc compiler and for the C# I use Protogen. The scripts for the Java/C++ class creation is @ECHO OFF SET SRC_DIR=%~dp0 REM Make Java and C++ SET JAVA_OUT_DIR=%SRC_DIR%\..\taurus-messages-java\src\main\java if not exist %JAVA_OUT_DIR% ( mkdir %JAVA_OUT_DIR% ) SET CPP_OUT_DIR=%SRC_DIR%\..\taurus-messages-cpp if not exist %CPP_OUT_DIR% ( mkdir %CPP_OUT_DIR% ) protoc -I=%SRC_DIR% --java_out=%JAVA

Using ProtoBuf-net with gRPC

陌路散爱 提交于 2019-12-06 08:32:00
问题 I am trying to build a PoC at work that utilizes gRPC. The google document here takes us through a sample application. I was wondering if protobuf-net, and specifically protogen, had the capability to understand service definitions and classes necessary to perform gRPC calls? Or is this something being worked on? Would it work if I use google's protoc for client and server code generation(which involves the service definitions and RPC calls) and protobuf-net for my business objects. 回答1:

Using ProtoBuf-net with gRPC

霸气de小男生 提交于 2019-12-04 12:59:04
I am trying to build a PoC at work that utilizes gRPC. The google document here takes us through a sample application. I was wondering if protobuf-net, and specifically protogen, had the capability to understand service definitions and classes necessary to perform gRPC calls? Or is this something being worked on? Would it work if I use google's protoc for client and server code generation(which involves the service definitions and RPC calls) and protobuf-net for my business objects. protobuf-net.Grpc is now a thing... albeit in preview. When .NET Core 3 comes out, we should be able to make

Protogen Vs. Protoc Compiler Options

狂风中的少年 提交于 2019-12-02 00:19:53
I have some .proto files used to compile classes from Java, C++ and C#. For Java and C++ I use the Protoc compiler and for the C# I use Protogen. The scripts for the Java/C++ class creation is @ECHO OFF SET SRC_DIR=%~dp0 REM Make Java and C++ SET JAVA_OUT_DIR=%SRC_DIR%\..\taurus-messages-java\src\main\java if not exist %JAVA_OUT_DIR% ( mkdir %JAVA_OUT_DIR% ) SET CPP_OUT_DIR=%SRC_DIR%\..\taurus-messages-cpp if not exist %CPP_OUT_DIR% ( mkdir %CPP_OUT_DIR% ) protoc -I=%SRC_DIR% --java_out=%JAVA_OUT_DIR% --cpp_out=%CPP_OUT_DIR% %SRC_DIR%taurus-mux.proto protoc -I=%SRC_DIR% --java_out=%JAVA_OUT