Sign inSign up

[Open-source] C++ Toolbox, a comprehensive Linux application software development tool library and run-time framework.

Open SourceAPI & Testing
2026-06-28 03:04 3 views • 0 downloads 0KB
[Open-source] C++ Toolbox, a comprehensive Linux application software development tool library and run-time framework.

1. Project Overview

C++ Toolbox, a complete Linux application software development tool library and run-time framework. It has communication libraries (TCP/UDP/serial port), HTTP, thread pool, timer pool, coroutine, log, command terminal, state machine, behavior tree, etc. very practical development components. It also has a complete and practical start-up framework. It can let application developers be liberated from implementation details, focus on functional logic.

2. Open Source License

Licensed under MIT

3. Screenshots

Module dependencies

Module pruning

Open the config.mk file, and you can disable the modules you don't need by commenting them out, but be aware of the dependencies between modules.app_y += xxxComment out the modules you don't need, but be aware of the dependencies between modules.

4. Feature Overview

Module Introduction

  • base, base library, including log printing, common tools, etc.
  • util, utility library, may be used in business code, contains PidFile,Serializer,ArgumentParser,StateMachine,TimeCounter etc.
  • event, event library, implements Fd, Timer, Signal three kinds of event-driven;
  • log, log output library, implemented terminal, syslog, file form log output;
  • eventx, event extension library, includes ThreadPool thread pool module, used for handling blocking transactions; TimerPool timer pool module;
  • network, network library, implemented serial port, terminal, UDP, TCP communication modules;
  • http, HTTP library, based on network, implemented HTTP server and client modules;
  • coroutine, coroutine library, well-known, asynchronous framework not convenient for handling sequential business, coroutine compensates;
  • mqtt, MQTT client library;
  • terminal, terminal, similar shell command terminal, can implement runtime interaction with program;
  • main, application program framework, implemented complete program startup process and framework, let developers only care about business code;
  • alarm, alarm module, implemented 4 common alarms: CRON alarm, single alarm, weekly cycle alarm, working day alarm;
  • flow, action module, solved the difficulty of executing sequential actions in asynchronous mode;

5. Tech Stack

cpp-tbox, full name: C++ Treasure Box, C++ development treasure box, based on event service type application development library.

applicable environment

  • Linux environment, mainly for service type applications;
  • C++11 and above.

External library dependencies

Library name

Dependency modules

Description

Installation method

googletest

All modules

Unit test. If unit testing is not performed, it can be ignored.

sudo apt install google-mock

libevent

event

Not dependent by default, dependent when WITH_LIBEVENT is enabled in event/config.mk

sudo apt install libevent-dev

libev

event

Not dependent by default, dependent when WITH_LIBEV is enabled in event/config.mk

sudo apt install libev-dev

mosquitto

mqtt

MQTT library

sudo apt install libmosquitto-dev

nlohmann/json

main

Used as configuration data

Download json_fwd.hpp and json.hpp to the header file directory, such as: /usr/local/include/nlohmann/

Installation command

System

Installation command

Ubuntu/Debian

apt install -y g++ make google-mock libevent-dev libev-dev libmosquitto-dev

If you build

Enter the top-level directory of cpp-tbox and execute the command:

STAGING_DIR=$HOME/.local make modules RELEASE=1

After completion, all header files are exported to $HOME/.local/include/All library files are output to $HOME/.local/lib/If you do not specify the STAGING_DIRparameter, it defaults to .staging。

In your own project's Makefile, you need to add the following content:

CXXFLAGS += -I$(HOME)/.local/include
LDFLAGS += -L$(HOME)/.local/lib -ltbox_xxxxx

Then you can use the components of tbox.

#1
资源直链https://gitee.com/cpp-master/cpp-tbox
Download