overlay on /var/lib/docker/overlay2/04ea1faa8074e5862f40eecdba968bd9b7f222cb30e5bf6a0b9a9c48be0940f2/merged type overlay (rw,relatime,lowerdir=/var/lib/docker/overlay2/l/B74PWZCBMRCWXFH5UL2ZXB5WEU:/var/lib/docker/overlay2/l/WNHICVPVSDNUGSCZW435TPSMOK,upperdir=/var/lib/docker/overlay2/04ea1faa8074e5862f40eecdba968bd9b7f222cb30e5bf6a0b9a9c48be0940f2/diff,workdir=/var/lib/docker/overlay2/04ea1faa8074e5862f40eecdba968bd9b7f222cb30e5bf6a0b9a9c48be0940f2/work)
buffer:缓冲将数据缓冲下来,解决速度慢和快的交接问题;速度快的需要通过缓冲区将数据一点一点传给速度慢的区域。 例如:从内存中将数据往硬盘中写入,并不是直接写入,而是缓冲到一定大小之后刷入硬盘中。 A buffer is something that has yet to be “written” to disk.
cache:缓存实现数据的重复使用,速度慢的设备需要通过缓存将经常要用到的数据缓存起来,缓存下来的数据可以提供高速的传输速度给速度快的设备。 例如:将硬盘中的数据读取出来放在内存的缓存区中,这样以后再次访问同一个资源,速度会快很多。 A cache is something that has been “read” from the disk and stored for later use.
// Example usage: // // Say you have a message defined as: // // message Foo { // optional string text = 1; // repeated int32 numbers = 2; // } // // Then, if you used the protocol compiler to generate a class from the above // definition, you could use it like so: // // std::string data; // Will store a serialized version of the message. // // { // // Create a message and serialize it. // Foo foo; // foo.set_text("Hello World!"); // foo.add_numbers(1); // foo.add_numbers(5); // foo.add_numbers(42); // // foo.SerializeToString(&data); // } // // { // // Parse the serialized message and check that it contains the // // correct data. // Foo foo; // foo.ParseFromString(data); // // assert(foo.text() == "Hello World!"); // assert(foo.numbers_size() == 3); // assert(foo.numbers(0) == 1); // assert(foo.numbers(1) == 5); // assert(foo.numbers(2) == 42); // }
如下可以将Message转换为基本类型
1 2 3
int size = reqMsg.ByteSizeLong(); char* array = new char[size]; reqMsg.SerializeToArray(array, size);
class XXXServer { // 客户端使用的桩 class Stub // base class Service // 各种版本的rpc包装,但都继承自base class WithAsyncMethod_XXX typedef WithAsyncMethod_XXX<Service > AsyncService; typedef ExperimentalWithCallbackMethod_XXX<Service > CallbackService; class WithGenericMethod_XXX class WithRawMethod_XXX typedef WithStreamedUnaryMethod_XXX<Service > StreamedUnaryService; }
# for gsl-lite target add_library(gsl-lite INTERFACE) target_include_directories(gsl-lite SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/gsl-lite/include)
# NOTE: This example uses cmake version 3.14 (FetchContent_MakeAvailable). # Since it streamlines the FetchContent process cmake_minimum_required(VERSION 3.14)
include(FetchContent)
# In this example we are picking a specific tag. # You can also pick a specific commit, if you need to. FetchContent_Declare(GSL GIT_REPOSITORY "https://github.com/microsoft/GSL" GIT_TAG "v3.1.0" )
FetchContent_MakeAvailable(GSL)
# Now you can link against the GSL interface library add_executable(foobar)
# Link against the interface library (IE header only library) target_link_libraries(foobar PRIVATE GSL)
##cmake使用openssl存在问题
因为openssl不用cmake,也就没有.cmake文件, 导致项目配置失败
1 2 3
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR)
# - Try to find libproxy # Once done this will define # # LIBPROXY_FOUND - system has libproxy # LIBPROXY_INCLUDE_DIR - the libproxy include directory # LIBPROXY_LIBRARIES - libproxy library # # Copyright (c) 2010, Dominique Leuenberger # # Redistribution and use is allowed according the license terms # of libproxy, which this file is integrated part of.
# Find proxy.h and the corresponding library (libproxy.so) FIND_PATH(LIBPROXY_INCLUDE_DIR proxy.h ) FIND_LIBRARY(LIBPROXY_LIBRARIES NAMES proxy )
../../lib/libhacore.a(File.cpp.o): In function `_ZN2ha4core9gid2groupB5cxx11Ej': /tmp/src/ha/core/File.cpp:213: warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking ../../lib/libhacore.a(File.cpp.o): In function `ha::core::group2gid(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int&)': /tmp/src/ha/core/File.cpp:291: warning: Using 'getgrnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking ../../lib/libhacore.a(File.cpp.o): In function `ha::core::username2uid(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int&)': /tmp/src/ha/core/File.cpp:271: warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking ../../lib/libhacore.a(File.cpp.o): In function `_ZN2ha4core12uid2usernameB5cxx11Ej': /tmp/src/ha/core/File.cpp:194: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking CMakeFiles/hasync-exec.dir/main.cpp.o: In function `boost::asio::detail::socket_ops::getaddrinfo(char const*, char const*, addrinfo const&, addrinfo**, boost::system::error_code&)': /usr/local/include/boost/asio/detail/impl/socket_ops.ipp:3348: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../lib64/libcrypto.a(b_sock.o): In function `BIO_gethostbyname': b_sock.c:(.text+0x51): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../lib64/libcares.a(libcares_la-ares_getaddrinfo.o): In function `ares_getaddrinfo': ares_getaddrinfo.c:(.text+0x73f): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../lib64/libcares.a(libcares_la-ares_getnameinfo.o): In function `lookup_service.part.0.constprop.2': ares_getnameinfo.c:(.text+0x32d): warning: Using 'getservbyport_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
template <typename T, int N> voidfoo(){ T t[N]; } template <typename T, int N> structFoo { T t[N]; }; intmain(){ // array of two int foo<int, 2>(); // class has a array of two int Foo<int, 2> F; }
//overloaded version to handle all those special std::endl and others... std::ostream& operator,(std::ostream& out, std::ostream&(*f)(std::ostream&)) { out << f; return out; }