connectivecpp / utility-rack Goto Github PK
View Code? Open in Web Editor NEWA small set of general purpose C++ utility classes and functions
License: Boost Software License 1.0
A small set of general purpose C++ utility classes and functions
License: Boost Software License 1.0
The shared_buffer.hpp classes (mutable_shared_buffer and const_shared_buffer) are better grouped with the marshall facilities, since that is what they are specifically designed for. The utility directly is for more general purpose functions and classes.
The unit tests can be enhanced by processing command line arguments. This will allow unit testing with variable amounts of generated data.
All casts should be C++ style, and in general, casting should be avoided (i.e. every cast needs to be analyzed as to why it is there). Data into and out of network buffers (e.g. going into or out of a shared_buffer) should be serialized, rather than "cast in place".
There are multiple enhancements and improvements needed in our CMake files:
Currently (Apr 2019) the only Boost dependency in the utility-rack repository is in the wait_queue_test and shared_buffer_demo.cpp. The wait_queue_test can be changed to use a different circular buffer, and the shared_buffer_demo app can be changed to use the utility marshalling facilities.
A good quality circular buffer to test with (in addition to Martin's ring-span-lite) is:
https://github.com/JustasMasiulis/circular_buffer
It is a high quality, STL style, single header container.
While Boost is an excellent, high quality set of libraries, it simplifies utility-rack dependency management not to have it as a dependency.
There is significant common code in the CMake files which needs to be split out and included as appropriate. Some of it spans multiple repositories so it may make sense to have the master versions in a special place in the utility-rack repository.
The demo programs need to be const correct. Methods that do not modify object data need to be const qualified, and literals need to be const or constexpr, as appropriate (with constexpr preferred). Parameters to functions that are not modified or passed by value should be const qualified.
The demo programs are missing includes, they happen to compile because "gift includes" many other headers. Specifically (and this is not inclusive):
EXIT_SUCCESS:
std::string:
u_int64_t: should be std::uint64_t, the header is
std::byte:
Create functions to marshall and unmarshall a variable length integer. The "append" / marshall function will take an integer in native format, and create a 1 or 2 or 3 or 4 (or more) byte integer. The first byte will contain values from 0-127, and the MSB (most significant bit) will designate whether another byte is needed (for larger values). The "extract" / unmarshall function will perform the converse.
One usage of this will be in the MQTT wire protocol (see section 1.5.5 of the MQTT 5.0 spec).
A good place for these functions is in the "extract_append_val.hpp" header in the marshall directory of the utility-rack repo.
Group the example applications by using the following doxygen command at the top of each source file:
@InGroup example_module
This will generate more organized doxygen documentation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.