Message Handling with Boolean Algebra
nce 4What this talk is about The workings of a message-handling library. How messages and the fields in them are specified. Efficiently identifying (with matchers) a message coming off the wire. The expressions https://github.com/intel/compile-time-init-build 7Part 1 Fields and messages: how they are structured and specified. 8Fields A field is: a human-readable name a type (almost always integral IP Address 4 128 Destination IP Address 5 160 Options (if IHL > 5) ⋮ ⋮ 14 448 10IPv4 Header Fields 1: using version = 2: field<"version", std::uint8_t>::located; 3: 0 码力 | 103 页 | 4.37 MB | 5 月前3C++20 镶 SQL
meta_structs for fields and parameters templatestruct meta_structs_from_query { static constexpr auto ts = parse_type_specs (); using fields_type = typename typename meta_struct_from_type_specs< query_string, ts.fields, false, std::make_index_sequence fields.size()>>::type; using parameters_type = typename meta_struct_from_type_specs< query_string, ts.params constexpr auto ret_counts = get_type_spec_count (); combined_type_specs fields, ret_counts.params> ret = {}; … return ret; }combined_type_specs and type_specs template 0 码力 | 46 页 | 775.02 KB | 5 月前3Implementing Reflection Using the New C++20 Tooling Opportunity: Modules
Binary, JSON, etc. 6 json serialize_struct(any any_value) { json json; for (Field f : reflect_fields(any_value)) { json[f.name]["value"] = f.value(); json[f.name]["type"] = f.type; } return json; serialize_struct(any_value); } } json serialize_struct(any any_value) { json json; for (Field f : reflect_fields(any_value)) { json[f.name]["value"] = value_to_json(f.value()); json[f.name]["type"] = f.type; Go from client API 1 0 json serialize_struct(any any_value) { json json; for (Field f : reflect_fields(any_value)) { json[f.name]["value"] = f.value(); json[f.name]["type"] = f.type; } return json;0 码力 | 53 页 | 1.43 MB | 5 月前3Using Modern C++ to Build XOffsetDatastructure
memory data structure into a data buffer. This transformation requires traversing and encoding all fields. • Both MessagePack and Protocol Buffers follow this approach. Fanchen Su, XOffsetDatastructure data buffer back into a memory data structure. This conversion needs traversing and decoding all fields. • Both MessagePack and Protocol Buffers employ this method. Fanchen Su, XOffsetDatastructure structure, which becomes the data buffer. • This transformation requires traversing and setting fields in memory using Builders. • Examples of solutions that use this approach include FlatBuffers and0 码力 | 111 页 | 3.03 MB | 5 月前3The Beauty and Power of Primitive C++
programming errors could have serious consequences • May require random access to fields • Maybe the size of some fields cannot be known until run time • Maybe read at B, modify, and pass along to C Stroustrup message descriptor knows • what message is being written/read • where the buffer is • where the fields are being mapped to Message buffer: Sequence of bytes std::string Int32_t double[12] Stroustrup Some want guarantees that some fields are always written • Some necessary types are not native in all needed languages • Some want static guarantees that only a subset of fields can be accessed • Use standard-library0 码力 | 53 页 | 1.03 MB | 5 月前3Conan 1.38 Documentation
see, some of the libraries end with a @ symbol followed by two strings separated by a slash. These fields are the user and channel for the Conan package, and they are useful if you want to make specific inspecting the recipe with conan getcommand: $ conan get poco/1.9.4@ To see only specific fields of the recipe you can use the conan inspect command instead: 6.1. Installing dependencies 39 Conan behavior in Conan v1.x) Conan will store a modified version of the conanfile.py with the values of the fields in plain text: import os from conans import ConanFile, CMake, tools class HelloConan(ConanFile): 0 码力 | 809 页 | 7.02 MB | 1 年前3Conan 1.39 Documentation
see, some of the libraries end with a @ symbol followed by two strings separated by a slash. These fields are the user and channel for the Conan package, and they are useful if you want to make specific inspecting the recipe with conan getcommand: $ conan get poco/1.9.4@ To see only specific fields of the recipe you can use the conan inspect command instead: 6.1. Installing dependencies 39 Conan behavior in Conan v1.x) Conan will store a modified version of the conanfile.py with the values of the fields in plain text: import os from conans import ConanFile, CMake, tools class HelloConan(ConanFile): 0 码力 | 819 页 | 7.05 MB | 1 年前3Conan 1.40 Documentation
see, some of the libraries end with a @ symbol followed by two strings separated by a slash. These fields are the user and channel for the Conan package, and they are useful if you want to make specific inspecting the recipe with conan getcommand: $ conan get poco/1.9.4@ To see only specific fields of the recipe you can use the conan inspect command instead: 6.1. Installing dependencies 39 Conan behavior in Conan v1.x) Conan will store a modified version of the conanfile.py with the values of the fields in plain text: import os from conans import ConanFile, CMake, tools class HelloConan(ConanFile): 0 码力 | 823 页 | 7.06 MB | 1 年前3Conan 1.41 Documentation
see, some of the libraries end with a @ symbol followed by two strings separated by a slash. These fields are the user and channel for the Conan package, and they are useful if you want to make specific inspecting the recipe with conan getcommand: $ conan get poco/1.9.4@ To see only specific fields of the recipe you can use the conan inspect command instead: 6.1. Installing dependencies 39 Conan behavior in Conan v1.x) Conan will store a modified version of the conanfile.py with the values of the fields in plain text: import os from conans import ConanFile, CMake, tools class HelloConan(ConanFile): 0 码力 | 835 页 | 7.10 MB | 1 年前3Conan 1.42 Documentation
see, some of the libraries end with a @ symbol followed by two strings separated by a slash. These fields are the user and channel for the Conan package, and they are useful if you want to make specific inspecting the recipe with conan getcommand: $ conan get poco/1.9.4@ To see only specific fields of the recipe you can use the conan inspect command instead: 6.1. Installing dependencies 39 Conan behavior in Conan v1.x) Conan will store a modified version of the conanfile.py with the values of the fields in plain text: import os from conans import ConanFile, CMake, tools class HelloConan(ConanFile): 0 码力 | 841 页 | 7.12 MB | 1 年前3
共 94 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10