![]() |
libfilezilla
|
Common base class for all events. More...
#include <event.hpp>
Public Member Functions | |
event_base (event_base const &)=default | |
event_base & | operator= (event_base const &)=default |
event_base (event_base &&)=default | |
event_base & | operator= (event_base &&)=default |
virtual size_t | derived_type () const =0 |
Common base class for all events.
If possible, use simple_event<> below instead of deriving from event_base directly.
Keep events as simple as possible. Avoid mutexes in your events.
|
pure virtual |
The returned pointer must be unique for the derived type such that: event_base& a = ... event_base& b = ... assert((a.derived_type() == b.derived_type()) == (typeid(a) == typeid(b)));
Best solution is to have your derived type return the address of a static data member of it, as done in simple_event.
Implemented in simple_event< UniqueType, Values >, simple_event< aio_buffer_event_type, aio_waitable const * >, simple_event< aio_buffer_event_type, aio_waitable const * >, simple_event< certificate_verification_event_type, tls_layer *, tls_session_info >, simple_event< certificate_verification_event_type, tls_layer *, tls_session_info >, simple_event< hostaddress_event_type, socket_event_source *, std::string >, simple_event< hostaddress_event_type, socket_event_source *, std::string >, simple_event< hostname_lookup_event_type, hostname_lookup *, int, std::vector< std::string > >, simple_event< hostname_lookup_event_type, hostname_lookup *, int, std::vector< std::string > >, simple_event< invoker_event_type, std::function< void()> >, simple_event< invoker_event_type, std::function< void()> >, simple_event< process_event_type, process *, process_event_flag >, simple_event< process_event_type, process *, process_event_flag >, simple_event< socket_event_type, socket_event_source *, socket_event_flag, int >, simple_event< socket_event_type, socket_event_source *, socket_event_flag, int >, simple_event< timer_event_type, timer_id >, and simple_event< timer_event_type, timer_id >.