Skip to content

yamaha-bps/cbr_utils

Repository files navigation

Contributors Forks Stargazers Issues MIT License Coverage


Logo

Cyber Utilities

Collection of various C++ programmatic tools.
Explore the repo»
Explore the docs»

Report Bug · Request Feature

Table of Contents

  1. Content Overview
  2. Dependencies
  3. Getting Started
  4. Usage
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Acknowledgements

Content overview

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.

Clocks and timers

Compile time loop

  • static_for.hpp: Compile time loop over integers. Also provides utility loop over boost::hana::Struct if boost::hana available.

Digitset

Enum

  • cyber_enum.hpp: Enum that can be implicitly constructed/converted to and from integers and strings.

Integer sequence

List of types

Plotting

Synchronization

Thead pool

  • thread_pool.hpp: Thread ressources pool with a fixed number of workers that can be used to dispatch work.

Type traits

  • type_traits.hpp: Various traits for common std types, as well as a type printing utility function and other goodies.

Yaml

Misc

Dependencies

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.

Getting Started

To get a local copy up and running on your machine, follow these simple steps.

Prerequisites

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

Build and Install

  1. Clone the repo

    git clone https://github.com/yamaha-bps/cbr_utils.git
  2. Make build directory

    mkdir cbr_utils/build && cd cbr_utils/build
  3. Build

    cmake ..
    make
  4. To build examples (optional)

    cmake .. -DBUILD_EXAMPLES=ON
    make
  5. To build and run the tests (optional):

    cmake .. -DBUILD_TESTING=ON
    make
    make test
  6. Install

    sudo make install
  7. To uninstall if you don't like it

    sudo make uninstall

Use with cmake

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)

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Thomas Gurriet - thomas_gurriet@yamaha-motor.com

Project Link: https://github.com/yamaha-bps/cbr_utils

Acknowledgements

Releases

No releases published

Packages

No packages published