EldenTree is an event handler library written in ✨C++✨ in order to please the gods.
- Compatible with all C++ standards (11 ... 26)
- Cross Platform
- Built-in concurrency support
- Qt like api style (almost!)
- Optimized and fast
When the gods are angry because of a junior Js developer you need a fast C++ event handler which you don't have to put sleep at the end of your main unlike other handlers!
#include <iostream>
#include "et/eldentree.hpp"
void godHandler(et::god::GodEvent const& event)
{
std::cout << "Zeous: " << event.info << '\n';
}
auto main() -> int
{
et::god::God const Zeous{
.name = "Zeous",
.id = 1
};
et::god::God const Medusa{
.name = "Medusa",
.id = 2
};
et::EldenTree tree;
tree.addGod(Zeous, godHandler);
tree.addEvent(Zeous, et::god::GodEvent{"zeous said: hi"});
tree.addEvent(Zeous, "zeous said: bye");
tree.addGod(Medusa, [](et::god::GodEvent const& event) {
std::cout << "Medusa: " << event.info << '\n';
});
tree.addEvent(Medusa, et::god::GodEvent{"medosa said fis fis"});
tree.addEvent(Medusa, et::god::GodEvent{"medosa said haha"});
tree.connect(Zeous, Medusa); // unlike Qt EldenTree is bidirectional
tree.addEvent(Medusa, "hello zeous from medusa");
tree.addEvent(Zeous, et::god::GodEvent{"hello medusa from zeus"});
std::cout << "something from main " << '\n';
return tree.exec();
}
To get started, see Requirements and Installation. see Documents for a more comprehensive feature overview.
EldenTree relays on some third-party libraries, such as Google Benchmark
and Google Test. Use Cmake to install them automatically via Vcpkg!
see all presets and select one! For example:
cmake --list-presets
cmake --preset Linux-Release-Ninja
cd linRelease-ninja-build && ninja
Dockerfile is also available, you can build it using
sudo docker build . -t eldentree:2.0.0
command.
Enable DO_DOC option in CMakeLists.txt . After that You'll see a doc folder in you build directory.
go inside it and then run doxygen Doxyfile.doc
.