SHAPER
9.12.0
|
Base class that manages the receiving and sending of all not Qt-events in the application. More...
Public Member Functions | |
EVENTS_EXPORT void | send (const std::shared_ptr< Events_Message > &theMessage, bool isGroup=true) |
Allows to send an event. More... | |
EVENTS_EXPORT void | registerListener (Events_Listener *theListener, const Events_ID theID, void *theSender=0, bool theImmediate=false) |
Registers (or adds if such listener is already registered) a listener that will be called on the event and from the defined sender. More... | |
EVENTS_EXPORT void | removeListener (Events_Listener *theListener) |
Remove the listener from internal maps if it was registered there. More... | |
EVENTS_EXPORT void | flush (const Events_ID &theID) |
Initializes sending of a group-message by the given ID. More... | |
EVENTS_EXPORT void | eraseMessages (const Events_ID &theID) |
Removes messages with the given ID: they are not needed anymore (UPDATE on close) More... | |
EVENTS_EXPORT bool | activateFlushes (const bool theActivate) |
Allows to disable flushes: needed in synchronization of document mechanism (to synchronize all and only then flush create, update, etc in correct order) More... | |
EVENTS_EXPORT void | clear (const Events_ID &theID) |
Clears all collected messages. More... | |
EVENTS_EXPORT bool | isFlushed (const Events_ID &theID) |
Returns true if the evement is flushed right now. More... | |
EVENTS_EXPORT void | setFlushed (const Events_ID &theID, const bool theValue) |
Sets the flag that the event is flished right now. More... | |
EVENTS_EXPORT bool | hasGrouppedEvent (const Events_ID &theID) |
Returns true if a loop accumulated events to be flashed. More... | |
Static Public Member Functions | |
static EVENTS_EXPORT Events_Loop * | loop () |
! Returns the main object of the loop, one per application. More... | |
static EVENTS_EXPORT Events_ID | eventByName (const char *theName) |
Returns the unique event by the given name. More... | |
Base class that manages the receiving and sending of all not Qt-events in the application.
One per application, initialized on start. Listeners must register in this loop to get events, called by senders. Sending of events is very fast (just adding to container). Performing of events is processed in separated thread, so, sender takes control back immideately.
|
static |
! Returns the main object of the loop, one per application.
|
static |
Returns the unique event by the given name.
Call this method only on initialization of object to speedup the events processing without parsing of the string.
! All events created in this session, uniquely identified by the text and char pointer
void Events_Loop::send | ( | const std::shared_ptr< Events_Message > & | theMessage, |
bool | isGroup = true |
||
) |
Allows to send an event.
theMessage | the enevt message to send |
isGroup | is true for grouping messages if possible |
void Events_Loop::registerListener | ( | Events_Listener * | theListener, |
const Events_ID | theID, | ||
void * | theSender = 0 , |
||
bool | theImmediate = false |
||
) |
Registers (or adds if such listener is already registered) a listener that will be called on the event and from the defined sender.
theListener | the object that will listen (process) the event |
theID | listen for messages with this ID |
theSender | listen only for this sender (NULL - listen everybody) |
theImmediate | for listeners who can not wait (no groupping mechanism is used for it) |
void Events_Loop::removeListener | ( | Events_Listener * | theListener | ) |
Remove the listener from internal maps if it was registered there.
theListener | a listener |
void Events_Loop::flush | ( | const Events_ID & | theID | ) |
Initializes sending of a group-message by the given ID.
void Events_Loop::eraseMessages | ( | const Events_ID & | theID | ) |
Removes messages with the given ID: they are not needed anymore (UPDATE on close)
bool Events_Loop::activateFlushes | ( | const bool | theActivate | ) |
Allows to disable flushes: needed in synchronization of document mechanism (to synchronize all and only then flush create, update, etc in correct order)
theActivate | a state about flushe is active. If false, the flush is disabled |
void Events_Loop::clear | ( | const Events_ID & | theID | ) |
Clears all collected messages.
bool Events_Loop::isFlushed | ( | const Events_ID & | theID | ) |
Returns true if the evement is flushed right now.
void Events_Loop::setFlushed | ( | const Events_ID & | theID, |
const bool | theValue | ||
) |
Sets the flag that the event is flished right now.
bool Events_Loop::hasGrouppedEvent | ( | const Events_ID & | theID | ) |
Returns true if a loop accumulated events to be flashed.