DUDS
Distributed Update of Data from Something
duds::os::linux::InputHandlers Class Reference

Maintains a set of InputSignal objects to respond to input events. More...

#include <InputHandlers.hpp>

Collaboration diagram for duds::os::linux::InputHandlers:

Public Member Functions

void clear ()
 Removes all input handlers. More...
 
boost::signals2::connection connect (EventTypeCode etc, const InputSignal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to an input event signal. More...
 
boost::signals2::connection connect (EventTypeCode etc, const InputSignal::group_type &group, const InputSignal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to an input event signal. More...
 
boost::signals2::connection connect (const InputSignal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to the default input event signal. More...
 
boost::signals2::connection connect (const InputSignal::group_type &group, const InputSignal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to the default input event signal. More...
 
boost::signals2::connection connectExtended (EventTypeCode etc, const InputSignal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to an input event signal. More...
 
boost::signals2::connection connectExtended (EventTypeCode etc, const InputSignal::group_type &group, const InputSignal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to an input event signal. More...
 
boost::signals2::connection connectExtended (const InputSignal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to the default input event signal. More...
 
boost::signals2::connection connectExtended (const InputSignal::group_type &group, const InputSignal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back)
 Make a connection to the default input event signal. More...
 
void disconnect (EventTypeCode etc, const InputSignal::group_type &group)
 Disconnect a group from an input event signal. More...
 
template<typename Slot >
void disconnect (EventTypeCode etc, const Slot &slotFunc)
 Disconnect a slot from an input event signal. More...
 
void disconnect (const InputSignal::group_type &group)
 Disconnect a group from the default input event signal. More...
 
template<typename Slot >
void disconnect (const Slot &slotFunc)
 Disconnect a slot from the default input event signal. More...
 
void disconnectAll (EventTypeCode etc)
 Disconnects all slots from an input event signal. More...
 
void disconnectAll ()
 Disconnects all slots from the default input event signal. More...
 
void handleEvent (EventTypeCode etc, std::int32_t value)
 Dispatches the provided input event to the appropriate InputSignal. More...
 

Private Types

typedef std::unordered_map< EventTypeCode, InputSignalInputMap
 A type that relates events to signal handlers. More...
 

Private Attributes

InputSignal defReceiver
 Handles input for events that are not listed in the receivers InputMap. More...
 
InputMap receivers
 Relates events to signal handlers. More...
 

Detailed Description

Maintains a set of InputSignal objects to respond to input events.

These are held separately from the input device so that the input handlers can be applied to multiple input devices.

Author
Jeff Jackowski

Definition at line 38 of file InputHandlers.hpp.

Member Typedef Documentation

◆ InputMap

A type that relates events to signal handlers.

Definition at line 42 of file InputHandlers.hpp.

Member Function Documentation

◆ clear()

void duds::os::linux::InputHandlers::clear ( )

Removes all input handlers.

Definition at line 33 of file InputHandlers.cpp.

◆ connect() [1/4]

boost::signals2::connection duds::os::linux::InputHandlers::connect ( EventTypeCode  etc,
const InputSignal::slot_type &  slot,
boost::signals2::connect_position  at = boost::signals2::at_back 
)
inline

Make a connection to an input event signal.

See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.

Parameters
etcThe event type and code that will be forwarded to the provided slot function.

Definition at line 72 of file InputHandlers.hpp.

◆ connect() [2/4]

boost::signals2::connection duds::os::linux::InputHandlers::connect ( EventTypeCode  etc,
const InputSignal::group_type &  group,
const InputSignal::slot_type &  slot,
boost::signals2::connect_position  at = boost::signals2::at_back 
)
inline

Make a connection to an input event signal.

See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.

Parameters
etcThe event type and code that will be forwarded to the provided slot function.

Definition at line 87 of file InputHandlers.hpp.

◆ connect() [3/4]

boost::signals2::connection duds::os::linux::InputHandlers::connect ( const InputSignal::slot_type &  slot,
boost::signals2::connect_position  at = boost::signals2::at_back 
)
inline

Make a connection to the default input event signal.

See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.

Definition at line 164 of file InputHandlers.hpp.

◆ connect() [4/4]

boost::signals2::connection duds::os::linux::InputHandlers::connect ( const InputSignal::group_type &  group,
const InputSignal::slot_type &  slot,
boost::signals2::connect_position  at = boost::signals2::at_back 
)
inline

Make a connection to the default input event signal.

See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.

Definition at line 176 of file InputHandlers.hpp.

◆ connectExtended() [1/4]

boost::signals2::connection duds::os::linux::InputHandlers::connectExtended ( EventTypeCode  etc,
const InputSignal::extended_slot_type &  slot,
boost::signals2::connect_position  at = boost::signals2::at_back 
)
inline

Make a connection to an input event signal.

See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.

Parameters
etcThe event type and code that will be forwarded to the provided slot function.

Definition at line 103 of file InputHandlers.hpp.

◆ connectExtended() [2/4]

boost::signals2::connection duds::os::linux::InputHandlers::connectExtended ( EventTypeCode  etc,
const InputSignal::group_type &  group,
const InputSignal::extended_slot_type &  slot,
boost::signals2::connect_position  at = boost::signals2::at_back 
)
inline

Make a connection to an input event signal.

See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.

Parameters
etcThe event type and code that will be forwarded to the provided slot function.

Definition at line 118 of file InputHandlers.hpp.

◆ connectExtended() [3/4]

boost::signals2::connection duds::os::linux::InputHandlers::connectExtended ( const InputSignal::extended_slot_type &  slot,
boost::signals2::connect_position  at = boost::signals2::at_back 
)
inline

Make a connection to the default input event signal.

See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.

Definition at line 189 of file InputHandlers.hpp.

◆ connectExtended() [4/4]

boost::signals2::connection duds::os::linux::InputHandlers::connectExtended ( const InputSignal::group_type &  group,
const InputSignal::extended_slot_type &  slot,
boost::signals2::connect_position  at = boost::signals2::at_back 
)
inline

Make a connection to the default input event signal.

See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.

Definition at line 201 of file InputHandlers.hpp.

◆ disconnect() [1/4]

void duds::os::linux::InputHandlers::disconnect ( EventTypeCode  etc,
const InputSignal::group_type &  group 
)
inline

Disconnect a group from an input event signal.

See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.

Parameters
etcThe event type and code of the items to remove.

Definition at line 133 of file InputHandlers.hpp.

◆ disconnect() [2/4]

template<typename Slot >
void duds::os::linux::InputHandlers::disconnect ( EventTypeCode  etc,
const Slot &  slotFunc 
)
inline

Disconnect a slot from an input event signal.

See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.

Parameters
etcThe event type and code of the items to remove.

Definition at line 147 of file InputHandlers.hpp.

◆ disconnect() [3/4]

void duds::os::linux::InputHandlers::disconnect ( const InputSignal::group_type &  group)
inline

Disconnect a group from the default input event signal.

See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.

Definition at line 214 of file InputHandlers.hpp.

◆ disconnect() [4/4]

template<typename Slot >
void duds::os::linux::InputHandlers::disconnect ( const Slot &  slotFunc)
inline

Disconnect a slot from the default input event signal.

See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.

Definition at line 226 of file InputHandlers.hpp.

◆ disconnectAll() [1/2]

void duds::os::linux::InputHandlers::disconnectAll ( EventTypeCode  etc)
inline

Disconnects all slots from an input event signal.

This actually destructs the signal object for the given event.

Parameters
etcThe event type and code of the items to remove.

Definition at line 155 of file InputHandlers.hpp.

◆ disconnectAll() [2/2]

void duds::os::linux::InputHandlers::disconnectAll ( )
inline

Disconnects all slots from the default input event signal.

Definition at line 232 of file InputHandlers.hpp.

◆ handleEvent()

void duds::os::linux::InputHandlers::handleEvent ( EventTypeCode  etc,
std::int32_t  value 
)

Dispatches the provided input event to the appropriate InputSignal.

Parameters
etcThe event type and code of the input event to handle.
valueThe value of the input.
Exceptions
objectAnything thrown by the functions invoked by the event's input signal.

Definition at line 22 of file InputHandlers.cpp.

Referenced by duds::os::linux::EvdevInput::connect().

Member Data Documentation

◆ defReceiver

InputSignal duds::os::linux::InputHandlers::defReceiver
private

Handles input for events that are not listed in the receivers InputMap.

Definition at line 50 of file InputHandlers.hpp.

Referenced by clear(), and handleEvent().

◆ receivers

InputMap duds::os::linux::InputHandlers::receivers
private

Relates events to signal handlers.

Definition at line 46 of file InputHandlers.hpp.

Referenced by clear(), and handleEvent().


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