Collection of various C++ programmatic tools.
Explore the repo»
Explore the docs»
Report Bug
·
Request Feature
- Content Overview
- Dependencies
- Getting Started
- Usage
- Roadmap
- Contributing
- License
- Contact
- Acknowledgements
All the provided utilities are in the cbr
namespace and are C++17
compatible, except for matplotlibcpp.hpp for which things have been left in the original matplotlibcpp
namespace, and which leverages C++20
constructs.
- clock_traits.hpp: Trait definition for chrono clocks.
- cyber_timer.hpp: Timer utility.
- loop_timer.hpp: Loop synchronization utility.
- static_for.hpp: Compile time loop over integers. Also provides utility loop over boost::hana::Struct if boost::hana available.
- digitset.hpp: Extention of std::bitset for bases > 2.
- cyber_enum.hpp: Enum that can be implicitly constructed/converted to and from integers and strings.
- integer_sequence.hpp: Utilities to build and use std::integer_sequence.
- integer_pack.hpp: IntegerPack class, similar to std::integer_sequence but with more functionalities.
- type_pack.hpp: Utility to manipulate a list of types.
- matplotlibcpp.hpp: C++20 ranges based version of https://github.com/lava/matplotlib-cpp.
- synchronizer.hpp: Utility to synchronize a message stream.
- thread_pool.hpp: Thread ressources pool with a fixed number of workers that can be used to dispatch work.
- type_traits.hpp: Various traits for common std types, as well as a type printing utility function and other goodies.
- yaml.hpp: Boost hana support and other goodies for yaml-cpp library.
- crtp.hpp: CRTP helper, small variation on https://www.fluentcpp.com/2017/05/19/crtp-helper/.
- introspection.hpp: Introspection utilities around boost::hana.
- utils.hpp: Various utilities to check if a range is sorted, check if a string is a valid filename, convert time to string, etc.
As decribed in the overview section, a couple of headers have depedencies. These dependecies are however optional, and not having then won't prevent installation of the package and usage of the headers that dont include these dependencies.
- Libboost (for yaml.hpp and introspection.hpp)
- yaml-cpp (for yaml.hpp)
- GTest (to build tests)
- Python, Numpy, Matplotlib (to use matplotlibcpp.hpp)
To get a local copy up and running on your machine, follow these simple steps.
To build the tests and examples, it is required to install all the dependencies. However, to just build and install the library, it is recommended but not necessary.
If the dependencies are found when building cbr_utils, then code linking to cbr_utils will automatically link to these dependencies. Otherwise, it will either have to be linked manually in the client's CMakeLists.txt, or certain headers won't be usable.
-
libboost
sudo apt install libboost-dev
-
yaml-cpp
sudo apt install libyaml-cpp-dev
-
GTest (only necessary to build tests)
sudo apt install libgtest-dev
-
Python, Numpy, Matplotlib (only necessary to use matplotlibcpp)
sudo apt install libpython3-dev python3-matplotlib python3-numpy
-
Clone the repo
git clone https://github.com/yamaha-bps/cbr_utils.git
-
Make build directory
mkdir cbr_utils/build && cd cbr_utils/build
-
Build
cmake .. make
-
To build examples (optional)
cmake .. -DBUILD_EXAMPLES=ON make
-
To build and run the tests (optional):
cmake .. -DBUILD_TESTING=ON make make test
-
Install
sudo make install
-
To uninstall if you don't like it
sudo make uninstall
To utilize cbr_utils
in your own project, include something along these lines in your CMakeLists.txt
find_package(cbr_utils)
add_executable(my_executable main.cpp)
target_link_libraries(my_executable cbr_utils::cbr_utils)
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Thomas Gurriet - [email protected]
Project Link: https://github.com/yamaha-bps/cbr_utils