07 memory_order_seq_cst 2024-09-17 / { C++ } { 内存模型与memory_order } memory_order_seq_cst std::memory_order_seq_cst表示最强约束。 Read On »
C语言抽象实现接口 2024-09-04 / { C++ } { 补充特性 } C语言抽象实现接口 实现方法很简单,使用函数指针放在接口结构体中。继承它的结构体(实际上是通过组合)调用这个接口的函数指针。 Read On »
00 proto 2024-08-31 / { C++ } { 3rdparty } { gRPC } proto syntax = "proto3";<!--more-->option java_package = "ex.grpc";package mathtest;// Defines the serviceservice MathTest { // Function invoked to send the request rpc sendRequest (MathRequest) returns (MathReply) {}}// The request message containing requested numbersmessage MathRequest { int32 a = 1; int32 b = 2;}// The response message containing responsemessage 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 »