itk::EventObject Class Reference
[ITK System Objects]

Abstraction of the Events used to communicating among filters and with GUIs. More...

#include <itkEventObject.h>

Inheritance diagram for itk::EventObject:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 EventObject ()
 EventObject (const EventObject &)
virtual ~EventObject ()
virtual EventObjectMakeObject () const =0
virtual void Print (std::ostream &os) const
virtual const char * GetEventName (void) const =0
virtual bool CheckEvent (const EventObject *) const =0

Protected Member Functions

virtual void PrintSelf (std::ostream &os, Indent indent) const
virtual void PrintHeader (std::ostream &os, Indent indent) const
virtual void PrintTrailer (std::ostream &os, Indent indent) const

Private Member Functions

typedef EventObjectEventFactoryFunction ()
void operator= (const EventObject &)


Detailed Description

Abstraction of the Events used to communicating among filters and with GUIs.

EventObject provides a standard coding for sending and receiving messages indicating things like the initiation of processes, end of processes, modification of filters.

EventObjects form a hierarchy similar to the itk::ExceptionObject allowing to factorize common events in a tree-like structure. Higher detail can be assigned by users by subclassing existing itk::EventObjects.

EventObjects are used by itk::Command and itk::Object for implementing the Observer/Subject design pattern. Observers register their interest in particular kinds of events produced by a specific itk::Object. This mechanism decouples classes among them.

As opposed to itk::Exception, itk::EventObject does not represent error states, but simply flow of information allowing to trigger actions as a consequence of changes occurring in state on some itk::Objects.

itk::EventObject carries information in its own type, it relies on the appropiate use of the RTTI (Run Time Type Information).

A set of standard EventObjects is defined near the end of itkEventObject.h.

See also:
itk::Command

itk::ExceptionObject

Definition at line 58 of file itkEventObject.h.


Constructor & Destructor Documentation

itk::EventObject::EventObject (  )  [inline]

Constructor and copy constructor. Note that these functions will be called when children are instantiated.

Definition at line 63 of file itkEventObject.h.

00063 {}

virtual itk::EventObject::~EventObject (  )  [inline, virtual]

Virtual destructor needed

Definition at line 68 of file itkEventObject.h.

00068 {}


Member Function Documentation

virtual EventObject* itk::EventObject::MakeObject (  )  const [pure virtual]

Create an Event of this type This method work as a Factory for creating events of each particular type.

Implemented in itk::TreeChangeEvent< TTreeType >, itk::TreeNodeChangeEvent< TTreeType >, itk::TreeAddEvent< TTreeType >, itk::TreeRemoveEvent< TTreeType >, and itk::TreePruneEvent< TTreeType >.

void itk::EventObject::Print ( std::ostream &  os  )  const [virtual]

Print Event information. This method can be overridden by specific Event subtypes. The default is to print out the type of the event.

Definition at line 24 of file itkEventObject.cxx.

References itk::Indent::GetNextIndent().

00025 {
00026   Indent indent;
00027   
00028   this->PrintHeader(os,0); 
00029   this->PrintSelf(os, indent.GetNextIndent());
00030   this->PrintTrailer(os,0);
00031 }  

virtual const char* itk::EventObject::GetEventName ( void   )  const [pure virtual]

virtual bool itk::EventObject::CheckEvent ( const EventObject  )  const [pure virtual]

Check if given event matches or derives from this event.

void itk::EventObject::PrintSelf ( std::ostream &  os,
Indent  indent 
) const [protected, virtual]

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Definition at line 57 of file itkEventObject.cxx.

00058 {
00059 }

void itk::EventObject::PrintHeader ( std::ostream &  os,
Indent  indent 
) const [protected, virtual]

Define a default print header for all objects.

Definition at line 38 of file itkEventObject.cxx.

00039 {
00040   os << std::endl;
00041   os << indent << "itk::" << this->GetEventName() << " (" << this << ")\n";
00042 }

void itk::EventObject::PrintTrailer ( std::ostream &  os,
Indent  indent 
) const [protected, virtual]

Define a default print trailer for all objects.

Definition at line 50 of file itkEventObject.cxx.

00051 {
00052   os << indent << std::endl;
00053 }


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

Generated at Wed Jul 14 06:23:13 2010 for OTB with doxygen 1.5.6