当前位置: 首页>>代码示例>>C#>>正文


C# FlatBuffers.FlatBufferBuilder类代码示例

本文整理汇总了C#中FlatBuffers.FlatBufferBuilder的典型用法代码示例。如果您正苦于以下问题:C# FlatBufferBuilder类的具体用法?C# FlatBufferBuilder怎么用?C# FlatBufferBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FlatBufferBuilder类属于FlatBuffers命名空间,在下文中一共展示了FlatBufferBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateListThreadsResponse

   public static int CreateListThreadsResponse(FlatBufferBuilder builder,
 int thread = 0)
   {
       builder.StartObject(1);
       ListThreadsResponse.AddThread(builder, thread);
       return ListThreadsResponse.EndListThreadsResponse(builder);
   }
开发者ID:SaviorXTanren,项目名称:xenia,代码行数:7,代码来源:ListThreadsResponse.cs

示例2: CreateTest

 public static Offset<Test> CreateTest(FlatBufferBuilder builder, short A, sbyte B) {
   builder.Prep(2, 4);
   builder.Pad(1);
   builder.PutSbyte(B);
   builder.PutShort(A);
   return new Offset<Test>(builder.Offset);
 }
开发者ID:zzragida,项目名称:flatbuffers,代码行数:7,代码来源:Test.cs

示例3: CreateListModuleEntry

 public static int CreateListModuleEntry(FlatBufferBuilder builder, uint Handle, uint FunctionCount)
 {
     builder.Prep(4, 8);
     builder.PutUint(FunctionCount);
     builder.PutUint(Handle);
     return builder.Offset;
 }
开发者ID:SaviorXTanren,项目名称:xenia,代码行数:7,代码来源:ListModuleEntry.cs

示例4: CreateArea

 public static Offset<Area> CreateArea(FlatBufferBuilder builder, float Largura, float Comprimento)
 {
     builder.Prep(4, 8);
     builder.PutFloat(Comprimento);
     builder.PutFloat(Largura);
     return new Offset<Area>(builder.Offset);
 }
开发者ID:talkitbr,项目名称:FlatBuffers,代码行数:7,代码来源:Area.cs

示例5: RunSerialize

    void RunSerialize()
    {
        for (int i = 0; i < N; i++)
        {
            FlatBufferBuilder messageBuffer = new FlatBufferBuilder(100);

            var text = messageBuffer.CreateString(@"Test message included");

            int embeddedOffset = EmbeddedMessage.CreateEmbeddedMessage(messageBuffer, i);

            TestMessage.StartTestMessage(messageBuffer);
            TestMessage.AddText(messageBuffer, text.Value);
            TestMessage.AddEmbedded(messageBuffer, embeddedOffset);
            TestMessage.AddId(messageBuffer, i);
            int testMessage = TestMessage.EndTestMessage(messageBuffer);
            TestMessage.FinishTestMessageBuffer(messageBuffer, testMessage);

            string s = "";
            for (int j = 0; j < messageBuffer.DataBuffer.Data.Length; j++) s += messageBuffer.DataBuffer.Data[i].ToString() + ", ";
            Debug.Log(s);

            using (MemoryStream ms = new MemoryStream(messageBuffer.DataBuffer.Data,
                                                      0,
                                                      messageBuffer.DataBuffer.Data.Length))
            {
                ByteBuffer byteBuffer = new ByteBuffer(ms.ToArray());
                TestMessage parsed = TestMessage.GetRootAsTestMessage(byteBuffer);

                if (parsed.Embedded().Id() != i) throw new Exception("Invalid embedded value");
            }
        }
    }
开发者ID:zaki,项目名称:unity-benchmarks,代码行数:32,代码来源:BenchmarkFlatbuffers.cs

示例6: CreateSecondTableInA

 public static Offset<SecondTableInA> CreateSecondTableInA(FlatBufferBuilder builder,
     Offset<NamespaceC.TableInC> refer_to_cOffset = default(Offset<NamespaceC.TableInC>))
 {
     builder.StartObject(1);
     SecondTableInA.AddReferToC(builder, refer_to_cOffset);
     return SecondTableInA.EndSecondTableInA(builder);
 }
开发者ID:CadeLaRen,项目名称:flatbuffers,代码行数:7,代码来源:SecondTableInA.cs

示例7: CreateTest

 public static int CreateTest(FlatBufferBuilder builder, short A, sbyte B) {
   builder.Prep(2, 4);
   builder.Pad(1);
   builder.PutSbyte(B);
   builder.PutShort(A);
   return builder.Offset();
 }
开发者ID:rdumusc,项目名称:flatbuffers,代码行数:7,代码来源:Test.cs

示例8: CreateGetFunctionResponse

   public static int CreateGetFunctionResponse(FlatBufferBuilder builder,
 int function = 0)
   {
       builder.StartObject(1);
       GetFunctionResponse.AddFunction(builder, function);
       return GetFunctionResponse.EndGetFunctionResponse(builder);
   }
开发者ID:SaviorXTanren,项目名称:xenia,代码行数:7,代码来源:GetFunctionResponse.cs

示例9: CreateVariableParameters

   public static Offset<VariableParameters> CreateVariableParameters(FlatBufferBuilder builder,
 VariableType type = (VariableType)0)
   {
       builder.StartObject(1);
       VariableParameters.AddType(builder, type);
       return VariableParameters.EndVariableParameters(builder);
   }
开发者ID:wuyuntao,项目名称:Synchronica,代码行数:7,代码来源:VariableParameters.cs

示例10: CreateAddBreakpointsRequest

   public static int CreateAddBreakpointsRequest(FlatBufferBuilder builder,
 int breakpoints = 0)
   {
       builder.StartObject(1);
       AddBreakpointsRequest.AddBreakpoints(builder, breakpoints);
       return AddBreakpointsRequest.EndAddBreakpointsRequest(builder);
   }
开发者ID:SaviorXTanren,项目名称:xenia,代码行数:7,代码来源:AddBreakpointsRequest.cs

示例11: CreateLoginRequest

   public static Offset<LoginRequest> CreateLoginRequest(FlatBufferBuilder builder,
 StringOffset name = default(StringOffset))
   {
       builder.StartObject(1);
       LoginRequest.AddName(builder, name);
       return LoginRequest.EndLoginRequest(builder);
   }
开发者ID:wuyuntao,项目名称:Synchronica,代码行数:7,代码来源:LoginRequest.cs

示例12: CreateanchorPointsHolder

   public static Offset<anchorPointsHolder> CreateanchorPointsHolder(FlatBufferBuilder builder,
 VectorOffset anchorPoints = default(VectorOffset))
   {
       builder.StartObject(1);
       anchorPointsHolder.AddAnchorPoints(builder, anchorPoints);
       return anchorPointsHolder.EndanchorPointsHolder(builder);
   }
开发者ID:kestrelm,项目名称:CreatureTools,代码行数:7,代码来源:anchorPointsHolder.cs

示例13: CreateLoginResponse

   public static Offset<LoginResponse> CreateLoginResponse(FlatBufferBuilder builder,
 int objectId = 0)
   {
       builder.StartObject(1);
       LoginResponse.AddObjectId(builder, objectId);
       return LoginResponse.EndLoginResponse(builder);
   }
开发者ID:wuyuntao,项目名称:Synchronica,代码行数:7,代码来源:LoginResponse.cs

示例14: CreateInputCommand

   public static Offset<InputCommand> CreateInputCommand(FlatBufferBuilder builder,
 Offset<CommandFrame> frame = default(Offset<CommandFrame>))
   {
       builder.StartObject(1);
       InputCommand.AddFrame(builder, frame);
       return InputCommand.EndInputCommand(builder);
   }
开发者ID:wuyuntao,项目名称:DeterministicLockstepNetworking,代码行数:7,代码来源:InputCommand.cs

示例15: CreateGetModuleRequest

   public static int CreateGetModuleRequest(FlatBufferBuilder builder,
 uint module_id = 0)
   {
       builder.StartObject(1);
       GetModuleRequest.AddModuleId(builder, module_id);
       return GetModuleRequest.EndGetModuleRequest(builder);
   }
开发者ID:SaviorXTanren,项目名称:xenia,代码行数:7,代码来源:GetModuleRequest.cs


注:本文中的FlatBuffers.FlatBufferBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。