Nana C++ Library. Reference for users.
What we need to use nana
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
nana::basic_event< Arg > Class Template Reference

the type of the members of general_events. More...

Inheritance diagram for nana::basic_event< Arg >:
nana::detail::event_base nana::detail::event_interface

Public Types

using arg_reference = const typename std::remove_reference< Arg >::type &
 

Public Member Functions

template<typename Function >
event_handle connect_front (Function &&fn)
 Creates an event handler at the beginning of event chain. More...
 
event_handle connect (void(*fn)(arg_reference))
 It will not get called if stop_propagation() was called. More...
 
template<typename Function >
event_handle connect (Function &&fn)
 It will not get called if stop_propagation() was called, because it is set at the end of the chain.. More...
 
template<typename Function >
event_handle operator() (Function &&fn)
 It will not get called if stop_propagation() was called. More...
 
template<typename Function >
event_handle connect_unignorable (Function &&fn, bool in_front=false)
 It will get called because it is unignorable. More...
 
void emit (arg_reference &arg, window window_handle)
 
- Public Member Functions inherited from nana::detail::event_base
 ~event_base ()
 
std::size_t length () const
 
void clear () noexcept
 
void remove (event_handle evt) override
 
- Public Member Functions inherited from nana::detail::event_interface
virtual ~event_interface ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from nana::detail::event_base
event_handle _m_emplace (detail::event_docker_interface *, bool in_front)
 
- Protected Attributes inherited from nana::detail::event_base
unsigned emitting_count_ { 0 }
 
bool deleted_flags_ { false }
 
std::vector
< detail::event_docker_interface * > * 
dockers_ { nullptr }
 

Detailed Description

template<typename Arg>
class nana::basic_event< Arg >

the type of the members of general_events.

It connect the functions to be called as response to the event and manages that chain of responses
It is a functor, that get called to connect a "normal" response function, with normal "priority".

If a response function need another priority (unignorable or called first) it will need to be connected with the specific connect function not with the operator() It also permit to "emit" that event, calling all the active responders.

Member Typedef Documentation

template<typename Arg>
using nana::basic_event< Arg >::arg_reference = const typename std::remove_reference<Arg>::type &

Member Function Documentation

template<typename Arg>
event_handle nana::basic_event< Arg >::connect ( void(*)(arg_reference fn)
inline

It will not get called if stop_propagation() was called.

template<typename Arg>
template<typename Function >
event_handle nana::basic_event< Arg >::connect ( Function &&  fn)
inline

It will not get called if stop_propagation() was called, because it is set at the end of the chain..

template<typename Arg>
template<typename Function >
event_handle nana::basic_event< Arg >::connect_front ( Function &&  fn)
inline

Creates an event handler at the beginning of event chain.

template<typename Arg>
template<typename Function >
event_handle nana::basic_event< Arg >::connect_unignorable ( Function &&  fn,
bool  in_front = false 
)
inline

It will get called because it is unignorable.

template<typename Arg>
void nana::basic_event< Arg >::emit ( arg_reference arg,
window  window_handle 
)
inline
template<typename Arg>
template<typename Function >
event_handle nana::basic_event< Arg >::operator() ( Function &&  fn)
inline

It will not get called if stop_propagation() was called.