libfilezilla
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
simple_event< UniqueType, Values > Class Template Referencefinal

This is the recommended event class. More...

#include <event.hpp>

Inheritance diagram for simple_event< UniqueType, Values >:
Inheritance graph
[legend]
Collaboration diagram for simple_event< UniqueType, Values >:
Collaboration graph
[legend]

Public Types

typedef UniqueType unique_type
 
typedef std::tuple< Values... > tuple_type
 

Public Member Functions

template<typename First_Value , typename... Remaining_Values>
 simple_event (First_Value &&value, Remaining_Values &&...values)
 
virtual size_t derived_type () const override
 Simply returns type()
 
 event_base ()=default
 
 event_base (event_base const &)=default
 
 event_base (event_base &&)=default
 
- Public Member Functions inherited from event_base
 event_base (event_base const &)=default
 
event_baseoperator= (event_base const &)=default
 
 event_base (event_base &&)=default
 
event_baseoperator= (event_base &&)=default
 

Static Public Member Functions

static size_t type ()
 Returns a unique id for the type such that can be used directly in derived_type.
 

Public Attributes

tuple_type v_
 The event value, gets built from the arguments passed in the constructor. More...
 

Detailed Description

template<typename UniqueType, typename... Values>
class fz::simple_event< UniqueType, Values >

This is the recommended event class.

Instantiate the template with a unique type to identify the type of the event and a number of types for the values.

Keep the values simple, in particular avoid mutexes in your values.

See also
event_handler for usage example.
Examples
aio.cpp, events.cpp, and timer_fizzbuzz.cpp.

Member Data Documentation

◆ v_

tuple_type v_
mutable

The event value, gets built from the arguments passed in the constructor.

You don't need to access this member directly if you use the dispatch mechanism.


The documentation for this class was generated from the following file: