Yunyin's blog
  • Home
  • Archive
  • Tags
  • Categories

    { 3rdparty }

  • 快速序列化宏

    2024-11-15 /
    • { C++ }
    • { 3rdparty }
    • { nlohmann }

    快速序列化宏

    版本3.9.0(2020)

    Read On »
  • 00 proto

    2024-08-31 /
    • { C++ }
    • { 3rdparty }
    • { gRPC }

    proto

    syntax = "proto3";
    <!--more-->

    option java_package = "ex.grpc";

    package mathtest;

    // Defines the service
    service MathTest {
    // Function invoked to send the request
    rpc sendRequest (MathRequest) returns (MathReply) {}
    }

    // The request message containing requested numbers
    message MathRequest {
    int32 a = 1;
    int32 b = 2;
    }

    // The response message containing response
    message MathReply {
    int32 result = 1;
    }
  • 01 Server

    2024-08-31 /
    • { C++ }
    • { 3rdparty }
    • { gRPC }

    Server

    • 继承ServiceName::Service创建serviceImplementation
    • 覆盖RPC方法,实现逻辑
    Read On »
  • 02 Client

    2024-08-31 /
    • { C++ }
    • { 3rdparty }
    • { gRPC }

    Client

    • 通过grpc::CreateChannel传入IP string创建channel。
    • 通过ServiceName::NewStub传入channel创建Stub
    Read On »
  • 00 protobuf数据类型和C++数据类型对照表

    2024-08-31 /
    • { C++ }
    • { 3rdparty }
    • { protobuf }

    protobuf数据类型和C++数据类型对照表

    Protobuf 类型 C++ 类型 备注
    Read On »
  • 01 简单结构体与命令生成

    2024-08-31 /
    • { C++ }
    • { 3rdparty }
    • { protobuf }

    简单结构体与命令生成

    1. quick start

    Read On »
  • 02 数组repeated

    2024-08-31 /
    • { C++ }
    • { 3rdparty }
    • { protobuf }

    数组repeated

    在使用Protobuf中,可以使用repeated关键字作为限定修饰符来表示一个字段可以有多个值,即重复出现的字段。repeated关键字可以用于以下数据类型:基本数据类型、枚举类型和自定义消息类型。

    Read On »
  • 03 枚举enum

    2024-08-31 /
    • { C++ }
    • { 3rdparty }
    • { protobuf }

    枚举enum

    1. quick start

    Read On »
  • 04 序列化与反序列化

    2024-08-31 /
    • { C++ }
    • { 3rdparty }
    • { protobuf }

    序列化与反序列化

    1. quick start

    Read On »
  • 05 导入其它proto文件

    2024-08-31 /
    • { C++ }
    • { 3rdparty }
    • { protobuf }

    导入其它proto文件

    1. quick start

    Read On »
12next »
© 2024 - Yunyin
Powered by Hexo , Theme - Icalm