1
0
mirror of https://github.com/wqking/eventpp.git synced 2024-12-25 23:30:49 +08:00

Improved documents

This commit is contained in:
wqking 2024-10-25 16:07:35 +08:00
parent 6fb4615769
commit e26fa6276c
3 changed files with 26 additions and 25 deletions

View File

@ -0,0 +1,22 @@
# Build eventpp for development
The library itself is header only and doesn't need building.
If you want to improve eventpp, you need to build the test code.
There are three parts of code to test the library,
- unittests: tests the library. They require C++17 since it uses generic lambda and `std::any` (the library itself only requires C++11).
- tutorials: sample code to demonstrate how to use the library. They require C++11. If you want to have a quick study on how to use the library, you can look at the tutorials.
- benchmarks: measure the library performance.
All parts are in the `tests` folder.
All three parts require CMake to build, and there is a makefile to ease the building.
Go to folder `tests/build`, then run `make` with different target.
- `make vc19` #generate solution files for Microsoft Visual Studio 2019, then open eventpptest.sln in folder project_vc19
- `make vc17` #generate solution files for Microsoft Visual Studio 2017, then open eventpptest.sln in folder project_vc17
- `make vc15` #generate solution files for Microsoft Visual Studio 2015, then open eventpptest.sln in folder project_vc15
- `make mingw` #build using MinGW
- `make linux` #build on Linux
- `make mingw_coverage` #build using MinGW and generate code coverage report

View File

@ -118,4 +118,4 @@ else(eventpp_FOUND)
endif(eventpp_FOUND)
```
Note: when using the method 3 with MingW on Windows, by default CMake will install eventpp in system folder which is not writable. You should specify another folder to install. To do so, replace `cmake ..` with `cmake .. -DCMAKE_INSTALL_PREFIX="YOUR_NEW_LIB_FOLDER"`.
Note: when using this method with MingW on Windows, by default CMake will install eventpp in non-writable system folder and get error. You should specify another folder to install. To do so, replace `cmake ..` with `cmake .. -DCMAKE_INSTALL_PREFIX="YOUR_NEW_LIB_FOLDER"`.

View File

@ -14,12 +14,12 @@
- [Using EventDispatcher](#using-eventdispatcher)
- [Using EventQueue](#using-eventqueue)
- [Documentations](#documentations)
- [Build the test code](#build-the-test-code)
- [Motivations](#motivations)
- [Change log](#change-log)
- [Contributors](#contributors)
eventpp is a C++ event library for callbacks, event dispatcher, and event queue. With eventpp you can easily implement signal and slot mechanism, publisher and subscriber pattern, or observer pattern.
eventpp is a C++ event library for callbacks, event dispatcher, and event queue. With eventpp you can easily implement signal and slot mechanism, publisher and subscriber pattern, or observer pattern.
eventpp is mature and production-ready.
![C++](https://img.shields.io/badge/C%2B%2B-11-blue)
![Compilers](https://img.shields.io/badge/Compilers-GCC%2FMSVC%2FClang%2FIntel-blue)
@ -58,8 +58,6 @@ Apache License, Version 2.0
## Version 0.1.3
The master branch is usable and stable.
There are some releases on Github, but usually the releases are far behind the latest code.
You should prefer to clone or fork the master branch instead of downloading the releases.
Don't worry about the large time span between commits and releases. The library is actively maintained.
The master branch is currently fully back compatible with the first version. So your project won't get any back compatible issues.
If you find any back compatible issue which is not announced, please report a bug.
@ -171,6 +169,7 @@ queue.process();
* [Utility header eventmaker.h -- auto generate event classes](doc/eventmaker.md)
* [Document of utilities functions](doc/eventutil.md)
* Miscellaneous
* [Build eventpp for development](doc/build_for_development.md)
* [Performance benchmarks](doc/benchmark.md)
* [FAQs, tricks, and tips](doc/faq.md)
* Tips and tricks
@ -183,26 +182,6 @@ queue.process();
* Translated documents
* [Chinese version 中文版](doc/cn/readme.md), thanks @marsCatXdu for the translation.
## Build the test code
The library itself is header only and doesn't need building.
There are three parts of code to test the library,
- unittests: tests the library. They require C++17 since it uses generic lambda and `std::any` (the library itself only requires C++11).
- tutorials: sample code to demonstrate how to use the library. They require C++11. If you want to have a quick study on how to use the library, you can look at the tutorials.
- benchmarks: measure the library performance.
All parts are in the `tests` folder.
All three parts require CMake to build, and there is a makefile to ease the building.
Go to folder `tests/build`, then run `make` with different target.
- `make vc19` #generate solution files for Microsoft Visual Studio 2019, then open eventpptest.sln in folder project_vc19
- `make vc17` #generate solution files for Microsoft Visual Studio 2017, then open eventpptest.sln in folder project_vc17
- `make vc15` #generate solution files for Microsoft Visual Studio 2015, then open eventpptest.sln in folder project_vc15
- `make mingw` #build using MinGW
- `make linux` #build on Linux
- `make mingw_coverage` #build using MinGW and generate code coverage report
## Motivations
I (wqking) am a big fan of observer pattern (publish/subscribe pattern), and I used this pattern extensively in my code. I either used GCallbackList in my [cpgf library](https://github.com/cpgf/cpgf) which is too simple and unsafe (not support multi-threading or nested events), or repeated coding event dispatching mechanism such as I did in my [Gincu game engine](https://github.com/wqking/gincu) (the latest version has be rewritten to use eventpp). Both methods are not fun nor robust.