EventGate Class Reference

This reference page is linked to from the following overview topics: Attributes, Node Events.



Detailed Description

This class represents an event receiver/triggerer point.

This is a special attribute, by linking these gates together you can receive events. If a class wants to emit one type of event and want to receive 5 events then it needs 6 EventGate attributes. The receiver eventgates must be linked to emitter evengates (See Connect()). It is also possible to link a receiver to another receiver, then the event will travel along the chain and all receiver will receive the event.

 class MyClass : public Node
 {
     aevent m_eLowMemory;

     MyClass( void )
     {
         m_eLowMemory.Connect( Kernel()->LowMemoryEvent );
     };
     void OnEvent( const EventGate &cEvent )
     {
          if ( cEvent == m_eLowMemory )
          {
              // free some buffers
          };
     };
 };

In the example above, the class MyClass has an EventGate member variable. The class connects this variable to the LowMemoryEvent variable in Kernel, so when the LowMemoryEvent event in kernel is triggered, the m_eLowMemory event object will be triggered also. The class can catch the even with the OnEvent() function as seen above.

Examples:

CurveBrush/CurveDisplayer.h, FrameCounter/FrameCounter.h, and MeshDisplace/displacer.h.

Definition at line 896 of file node.h.

#include <node.h>

Inheritance diagram for EventGate:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  EventGate (Node *pOwner, const QString &sID="")
  Standard constructor.
void  Trigger (void)
  Fire the event. Connected evengates will receive the event (See Node::OnEvent()).
void  Connect (EventGate &cEvent)
  Connect this eventgate to another one to receive events from that.
bool  operator== (const EventGate &cEvent) const
  Compare two eventgates.

Constructor & Destructor Documentation

EventGate ( Node pOwner,
const QString &  sID = "" 
)

Standard constructor.


Member Function Documentation

void Trigger ( void  )

Fire the event. Connected evengates will receive the event (See Node::OnEvent()).

void Connect ( EventGate cEvent )

Connect this eventgate to another one to receive events from that.

bool operator== ( const EventGate cEvent ) const

Compare two eventgates.


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

EventGate EventGate EventGate EventGate EventGate EventGate EventGate EventGate EventGate EventGate
EventGate EventGate EventGate EventGate EventGate EventGate EventGate EventGate EventGate EventGate