The SlotSig library

The SlotSig library is a library that provides type-safe connections between C++ classes.
Download

The SlotSig library Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Yves Bailly
  • Publisher web site:

The SlotSig library Tags


The SlotSig library Description

The SlotSig library is a library that provides type-safe connections between C++ classes. The SlotSig library is a library that provides type-safe connections between C++ classes.When programming in C, it's usual to use callback functions (moreover when you do GUI stuffs). In C++, we prefer to encapsulate things into classes, and usually we want a rather type-safety.This small library attempt to provide an easy-to-use, type-safe, C++-friendly solution to the problem. The idea is to define slots, either as global functions or member methods, that will be called when some signals are emitted The signals and slots do not need to really know about each other, only a pointer and a compatible signature is required.Inconsistent connections (when return type or parameters do not match) should be detected at compile-time.If you've heard about the Qt, libsigc++, Sigslot or boost libraries, or any other I'm not aware of (if this is the case, let me know !), maybe you wonder why yet another signals lib. Here are the main reasons :- Qt's system needs a preprocessor (called moc, for Meta-Object Compiler) that will produce additionnal code to enable the connections and handle the signal emitting ; it's quite simple to use, but you can't use templates on signal/slot-enabled classes, and inconsistencies are not detected at compile time but at runtime ;- I found libsig++ a great thing, but a little bit to complex to use, and I dislike some casts done into it ; I also dislike the fact that a function (or method) connected twice will be called twice when emitting the signal ;- Boost is fine, but to use the signals module you also need a rather large part of the whole lib ; there's nothing really wrong with that, I just wanted something smaller " and easier to use ;- It was fun to code, and because I did it, I find SlotSig the simplest signal/slot library available.What's New in This Release:· Incorporated the Makefile from Leopold Palomo-Avellaneda, to generate a global shared library containing the very small amount of static code. · Updated benchmarks. The 1.x versions of SlotSig will remain binary-compatible. No major new feature is expected, mainly cosmetic changes and bugfixes. The main line of development will be done in a 1.99.x branch, maybe leading someday to a 2.0 version.


The SlotSig library Related Software