adbus_Signal Struct Reference

Helper class to emit signals from C code. More...

Related Functions

(Note that these are not member functions.)



adbus_Signaladbus_sig_new (adbus_Member *mbr)
 Create a new signal for the given member.
void adbus_sig_free (adbus_Signal *s)
 Frees the signal.
void adbus_sig_reset (adbus_Signal *s)
 Removes all current bindings.
void adbus_sig_bind (adbus_Signal *s, adbus_Connection *c, const char *path, int pathSize)
 Adds a path/connection to emit on.
adbus_MsgFactoryadbus_sig_msg (adbus_Signal *s)
 Resets and returns the internal message factory.
void adbus_sig_emit (adbus_Signal *s)
 Emits the signal on all bound path/connection combos.

Detailed Description

Helper class to emit signals from C code.

adbus_Signal can be bound to the same member on any number of paths on any number of connections. The workflow to emit a signal is:

  1. Grab a message factory using adbus_sig_msg().
  2. Append arguments to the factory.
  3. Send off the signals messages using adbus_sig_send().
Note:
If there are no arguments a single call to adbus_sig_emit() will suffice.

For example:

  void EmitSignal()
  {
      adbus_MsgFactory* m = adbus_sig_msg(my_signal);
      adbus_msg_string(m, "foo", -1);
      adbus_sig_emit(my_signal);
  }

Friends And Related Function Documentation

void adbus_sig_emit ( adbus_Signal s  )  [related]

Emits the signal on all bound path/connection combos.

If there are any arguments they should have already been added by getting the message factory with adbus_sig_msg() and appending them.

adbus_MsgFactory * adbus_sig_msg ( adbus_Signal s  )  [related]

Resets and returns the internal message factory.

Note:
This sets the argument signature on the factory.

The documentation for this struct was generated from the following file:
 All Data Structures Files Functions Variables Friends Defines

Generated on Mon Mar 22 00:10:02 2010 for adbus by  doxygen 1.6.1