The Wayback Machine - https://web.archive.org/web/20210121054231/https://github.com/filcuc/hope
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
lib
 
 
 
 
 
 
 
 
 
 

README.md

Hope

A simple pure C++11 event loop with signals and slots

Build Status Build status codecov

Notes

This project doesn't aim to become a general purpose library. It was done for fun and scratching my own itch. That said it can be useful for simple command line projects

How it looks?

#include <hope/application.h>
#include <hope/timer.h>

using namespace hope;

class HelloWorldPrinter : public Object {
public:
    void say_hello() {
        std::cout << "Hello World" << std::endl;
    }
};

int main(int argc, char* argv[])
{
    Application app;

    HelloWorldPrinter printer;

    Timer timer;
    timer.set_duration(std::chrono::seconds(1));
    timer.triggered().connect(&printer, &HelloWorldPrinter::say_hello);
    timer.triggered().connect(&app, &Application::quit);
    timer.start();

    return app.exec();
}

Building

The project require a working C++11 compiler

mkdir build
cd build 
cmake ..
cmake --build .

Installing

Follow the build steps and simply execute

sudo make install
You can’t perform that action at this time.