-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the libAISignal wiki!
The libAISignal
is a C++ 11 library designed to share signals across process, locally or over the network.
Signal sharing means that a sending process can notify listening process something.
libAISignal
is not desgined to be a replacement for D-Bus. This AISignal is currently developed to be a lightweight IPC system for OCADrone. Used with the libAIRegistry
, it can also be used to call methods and store result, in a similar way than D-Bus. But this ins't its primary goal.
A signal is composed by a data (currently stored as std::string
), a channel (see bellow) and optionally an emitter name.
Tip: to store other fundamental types than string in a signal, cast types using std casts or by using KUtils
from libKNM-based cast methods.
Signals are send on channels. Like other libKNM-based tools, channels are stored in a tree structure:
-
.
is channels root node -
.test
is a channel namedtest
available at root node (.
) -
.system.user.auth
is a channel namedauth
available at path.system.user.auth
-
.test
and.test.other
are two valid channels ( KTree / KNode differentiate objets using their types)
The library provide objects to handle a server
, which is a class interacting a a single client. You can either start server objects (since they inherit from KThread) or by using you own system (like select
, take a look at KSocket::pool
class from libKNM).
Client-side object is named client
an can send and receive signals. Receiving signals is done in a separate thread. You can adjust client signals stack size, access signals in FIFO or LIFO, and subscribe to channels to receive signals. See page client's page to learn how to use this class.