Show EOL distros: 

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Provides a signal/slot mechanism (in the same vein as qt sigslots, boost::signals etc. for intra-process communication. These include some improvements - they do not need a preprocessor, are fully type safe, allow for simple connections via a posix style string identifier and are multithread-safe.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Provides a signal/slot mechanism (in the same vein as qt sigslots, boost::signals etc. for intra-process communication. These include some improvements - they do not need a preprocessor, are fully type safe, allow for simple connections via a posix style string identifier and are multithread-safe.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Provides a signal/slot mechanism (in the same vein as qt sigslots, boost::signals etc for intra-process communication. These include some improvements - they do not need a preprocessor, are fully type safe, allow for simple connections via a posix style string identifier and are multithread-safe.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Provides a signal/slot mechanism (in the same vein as qt sigslots, boost::signals etc for intra-process communication. These include some improvements - they do not need a preprocessor, are fully type safe, allow for simple connections via a posix style string identifier and are multithread-safe.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Provides a signal/slot mechanism (in the same vein as qt sigslots, boost::signals etc for intra-process communication. These include some improvements - they do not need a preprocessor, are fully type safe, allow for simple connections via a posix style string identifier and are multithread-safe.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Provides a signal/slot mechanism (in the same vein as qt sigslots, boost::signals etc for intra-process communication. These include some improvements - they do not need a preprocessor, are fully type safe, allow for simple connections via a posix style string identifier and are multithread-safe.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Provides a signal/slot mechanism (in the same vein as qt sigslots, boost::signals etc for intra-process communication. These include some improvements - they do not need a preprocessor, are fully type safe, allow for simple connections via a posix style string identifier and are multithread-safe.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Provides a signal/slot mechanism (in the same vein as qt sigslots, boost::signals etc for intra-process communication. These include some improvements - they do not need a preprocessor, are fully type safe, allow for simple connections via a posix style string identifier and are multithread-safe.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

Provides a signal/slot mechanism (in the same vein as qt sigslots, boost::signals etc for intra-process communication. These include some improvements - they do not need a preprocessor, are fully type safe, allow for simple connections via a posix style string identifier and are multithread-safe.

Overview

Signals and slots provide a means for intra-process communication. The classes here let you have a many-to-many relationship (unlike most event callback techniques), and also templatise the data transfer to allow the coder to customise the event data that is communicated from signal to slot. It also implements a few conditional (event) related classes.

Features

  • Lightweight - implements only the necessary features for practical usage.

  • Fully typesafe - signal-slot pairs must have the same type, loaded functions must also agree.

  • Convenient slot loading - global/static and member functions can be loaded with the same api.

  • Naming - can use posix style names to identify and perform convenient connections/disconnections.

  • Thread safe - slots can disconnect/self-destruct without worrying about segfaulting across threads.

Definitions

Signals

Anywhere that triggers an event requiring a callback to be executed can be implemented with a signal. These can be placed anywhere in your code and can be connected to one or many slots.

Slots

Anywhere that a callback function is required can be implemented with a slot. These can be placed anywhere in your code and are initialised with either a static (global) function, or a member function. Once initialised, they can be hooked up to a signal.

Message Data

The signal-slot pairs developed here only ever accept one template argument representing the data to be transmitted from signal to slot. It would be easy to extend this to more (aka SigSlot/Boost) but I have yet to find a need for it - if you wish multiple arguments, simply wrap up your data in a single struct/class. Conceptually, this makes the code more readable anyway.

The data class itself could be as simple as an error id or as complicated as the current state in a fsm. Note that both signal and slot must use the same type.

Compiling & Linking

Include the following at the top of any translation unit:

   1 #include <ecl/sigslots.hpp>
   2 
   3 // The types
   4 using ecl::Signal;
   5 using ecl::Slots;

You will also need to link to ecl_sigslots.

Tutorials

Examples

Wiki: ecl_sigslots (last edited 2013-01-07 00:20:54 by DanielStonier)