Tsar Class Reference

Tsar (Thread Save Add and Remove) is a singleton class to call functions (both signals and slots) in a thread save way without using any mutual exclusion primitives (mutex). More...

List of all members.

Public Member Functions

TsarEvent create_event (QObject *caller, void *argument, const char *slotSignature, const char *signalSignature)
bool add_event (TsarEvent &event)
void add_rt_event (TsarEvent &event)
void process_event_slot (const TsarEvent &event)
void process_event_signal (const TsarEvent &event)
void process_event_slot_signal (const TsarEvent &event)

Friends

class AudioDevice
Tsartsar ()


Detailed Description

Tsar (Thread Save Add and Remove) is a singleton class to call functions (both signals and slots) in a thread save way without using any mutual exclusion primitives (mutex).

Member Function Documentation

TsarEvent Tsar::create_event ( QObject *  caller,
void *  argument,
const char *  slotSignature,
const char *  signalSignature 
)

Creates a Tsar event. Add the tsar event to the event queue by calling add_event() If you need to add an event from the real time audio processing thread, use add_rt_event() instead!

Note: This function can be called both from the GUI and realtime audio thread and has a non blocking behaviour! (That is, it's a real time save function)

Parameters:
caller The calling object, needs to be derived from a QObject
argument The slot and/or signal argument which can be of any type.
slotSignature The 'signature' of the calling objects slot (equals the name of the slot function)
signalSignature The 'signature' of the calling objects signal (equals the name of the signal function)
Returns:
The newly created event.

Referenced by AddRemove::prepare_actions().

bool Tsar::add_event ( TsarEvent &  event  ) 

Use this function to add events to the event queue when called from the GUI thread.

Note: This function should be called ONLY from the GUI thread!

Parameters:
event The event to add to the event queue

Referenced by AddRemove::do_action(), and AddRemove::undo_action().

void Tsar::add_rt_event ( TsarEvent &  event  ) 

Use this function to add events to the event queue when called from the audio processing (real time) thread

Note: This function should be called ONLY from the realtime audio thread and has a non blocking behaviour! (That is, it's a real time save function)

Parameters:
event The event to add to the event queue

void Tsar::process_event_slot ( const TsarEvent &  event  ) 

This function can be used to process the events 'slot' part. Usefull when you have a Tsar event, but don't want/need to use tsar to call the events slot in a thread save way

Note: This function doesn't provide the thread savetiness you get with the add_event() function!

Parameters:
event The TsarEvent to be processed

Referenced by process_event_slot_signal().

void Tsar::process_event_signal ( const TsarEvent &  event  ) 

This function can be used to process the events 'signal' part. Usefull when you have a Tsar event, but don't want/need to use tsar to call the events signal in a thread save way

Note: This function doesn't provide the thread savetiness you get with the add_event() function!

Parameters:
event The TsarEvent to be processed

Referenced by process_event_slot_signal().

void Tsar::process_event_slot_signal ( const TsarEvent &  event  ) 

Convenience function. Calls both process_event_slot() and process_event_signal()

See also:
process_event_slot()

process_event_signal()

Note: This function doesn't provide the thread savetiness you get with the add_event() function!

Parameters:
event The TsarEvent to be processed

References process_event_signal(), and process_event_slot().

Referenced by AddRemove::do_action(), and AddRemove::undo_action().


Friends And Related Function Documentation

Tsar& tsar (  )  [friend]

Returns:
The Tsar instance.


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

Generated on Sun Mar 8 12:44:05 2009 for traverso by  doxygen 1.5.5