Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

L1394::EventHandle Class Reference
[L1394_Event]

This class represents the eventhandle to get information about an event. More...

#include <l1394_eventhandle.h>

Inheritance diagram for L1394::EventHandle:

L1394_MM::Window SimpleEventHandle L1394_MM::XShmImg List of all members.

Public Member Functions

EventHandle constructor
These functions creates the EventHandle objects.

 EventHandle ()
 Constructor.
virtual ~EventHandle ()
 Destructor.
Functions that are called by an event
These functions can be re-implement to handle a certain event.

virtual void busreset (const Card *)
 This method handles the BUSRESET event.
virtual void nodeDestroy (const Node *)
 this method handles the NODE_DESTROY event.
virtual void nodeDisabled (const Node *)
 This method handles the NODE_DISABLED event.
virtual void nodeEnabled (const Node *)
 This method handles the NODE_ENABLED event.

Detailed Description

This class represents the eventhandle to get information about an event.

The idea of this class is, to inherit external classes from this class, to get information about changes on FireWire bus. This Class provides functions for every defined event. After creating an EventHandle you can add it to every Node (see example).
By default all functions do nothing and only the interest functions must be re-implemented. At this time there are five functions (and events) that can be used:

Method busreset(const Card*):
This method is called if a busreset occur. This method is only called from Card objects.

Method nodeDisabled(const Node*):
This method is called, if a node is disconnected form the bus. The Node object is moved in the inactive_node_list, but not deleted.

Method nodeEnabled(const Node*):
This method is called, if a known node is reconnect to the bus. A known node, is a node which object is in the inactive_node_list.

Method nodeDestroy(const Node*):
This method is called, if the destructor of a Node object is called. After a defined time interval a Node object in the inactive_node_list is deleted.

A little example show the idea

  #include <l1394_session.h>
  using namespace l1394;
  class MyEventHandle : public EventHandle
  {
    MyEventHandle(Node* node) {my_node = node; my_node->addEventHandle(this);} //connect this handle to all events
    ~MyEventHandle()  {  if (my_node != NULL) my_node->removeEventHandle(this);}

    void busreset(const Card* n) { cout << "Bus reset" << endl; } //occur only, if my_node is a Card
    void nodeDisabled(const Node* n) { cout << "Node disconnected from bus "<< endl;}
    void nodeEnabled(const Node* n) {cout << "Node is back on bus" << endl;}
    void nodeDestroy(const Node* n) {cout << "Object is deleted " << endl; my_node = NULL;}
    private:
    Node* my_node;
 }

  int main(int argc, char* argv[])
  {
    Session *session = GetSession();
    Card* card = session->getCard(0);
    MyEventHandle* event_handle = NULL;
    if (card != NULL)
      event_handle = new MyEventHandle(card); //Now you get Information

    delete event_handle;
    delete session;
  }
Author:
Michael Repplinger

Definition at line 91 of file l1394_eventhandle.h.


Constructor & Destructor Documentation

L1394::EventHandle::EventHandle  )  [inline]
 

Constructor.

Definition at line 101 of file l1394_eventhandle.h.

L1394::EventHandle::~EventHandle  )  [virtual]
 

Destructor.

Definition at line 24 of file l1394_eventhandle.cpp.


Member Function Documentation

L1394::EventHandle::busreset const Card node  )  [inline, virtual]
 

This method handles the BUSRESET event.

Note that this event is only called by a Card object.
For a example see tutorial.

Parameters:
node : pointer to the Node object, that call this event.

Reimplemented in SimpleEventHandle.

Definition at line 120 of file l1394_eventhandle.h.

L1394::EventHandle::nodeDestroy const Node node  )  [inline, virtual]
 

this method handles the NODE_DESTROY event.

This event is called, if the destructor of a Node is called.
For a example see tutorial.

Parameters:
node : pointer to the Node object, that call this event.

Reimplemented in SimpleEventHandle.

Definition at line 130 of file l1394_eventhandle.h.

L1394::EventHandle::nodeDisabled const Node node  )  [inline, virtual]
 

This method handles the NODE_DISABLED event.

This event is called, if a FireWire node is disconnected from bus and the L1394 node object is inserted in the inactive_node_list.
For example see tutorial.

Parameters:
node : pointer to the Node object, that call this event.

Reimplemented in SimpleEventHandle.

Definition at line 141 of file l1394_eventhandle.h.

L1394::EventHandle::nodeEnabled const Node node  )  [inline, virtual]
 

This method handles the NODE_ENABLED event.

This event is called, if the Node object is removed from the inactive_node_list and insert in the active_node_list again.
For example see tutorial.

Parameters:
node : pointer to the Node object, that call this event.

Reimplemented in SimpleEventHandle.

Definition at line 152 of file l1394_eventhandle.h.


The documentation for this class was generated from the following files:
Generated on Wed Aug 24 00:36:44 2005 for L1394 by doxygen 1.4.2
L1394 library (NMM) grahics.cs.uni-sb.de/~repplix/l1394_home/