A simple demonstration of using the event system
#include <iostream>
#include <string>
#include <vector>
struct my_event_type;
{
public:
{}
virtual ~handler()
{
}
private:
{
fz::dispatch<my_event>(ev, this, &handler::on_my_event);
}
void on_my_event(std::string const& s, std::vector<int> const& v)
{
std::cout << "Received event with text \"" << s << "\" and a vector with " << v.size() << " elements" << std::endl;
}
};
int main()
{
handler h(l);
h.send_event<my_event>("Hello World!", std::vector<int>{23, 42, 666});
return 0;
}