casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Private Attributes
casa::DDModEvent Class Reference

Class used by DisplayDatas to signal change in data. More...

#include <DDModEvent.h>

Inheritance diagram for casa::DDModEvent:
casa::DisplayDataEvent casa::DisplayEvent

List of all members.

Public Member Functions

 DDModEvent (DisplayData *dd, const Record *rec)
 Constructor, taking a pointer to a DisplayData and a pointer to a data record.
virtual ~DDModEvent ()
 Destructor.
virtual const RecorddataRecord () const
 Return a pointer to the data record.

Protected Member Functions

 DDModEvent ()
 (Required) default constructor.
 DDModEvent (const DDModEvent &other)
 (Required) copy constructor.
DDModEventoperator= (const DDModEvent &other)
 (Required) copy assignment.

Private Attributes

const RecorditsRec
 the data record

Detailed Description

Class used by DisplayDatas to signal change in data.

Intended use:

Internal

Review Status

Date Reviewed:
yyyy/mm/dd

Etymology

"DisplayData Modified Event" describes "Events" (ie. things which happen at a measurable time) which signal to event handlers that the data of the transmitting displaydata has been modified.

Prerequisite

Synopsis

This class adds to the information stored in the DisplayDataEvent class. It adds a pointer to a record that holds the modified data. The structure of the record is specific to each type of Display Data so the event handlers will need to know the structure they are listening for

Example

    // Sending a DDModEvent from a Profile2dDD (inherits from ActiveCaching2dDD)
    Record rec;
    fillRecordWithData(rec); // DD specific function
    DDModEvent ev(this, &rec);
    ActiveCaching2dDD::handleEvent(ev); // let super classes send events
   
    // Receiving a DDModEvent from a Profile2dDD
    ..\.
    profile2dDD->addDisplayEventHandler(this);
    ..\.
    void MyClass::handleEvent(DisplayEvent &ev) {
      DDModEvent *dev = dynamic_cast<DDModEvent*>(&ev);
      if (dev) {
        Profile2dDD *pdd = dynamic_cast<Profile2dDD*>(dev->displayData());
        if (pdd) {
        // event from Profile2dDD received!
        }
      }
    }

Motivation

It's desirable to send some data with DisplayDataEvents that has information about the DisplayData and the data that is modified within it.

Thrown Exceptions

.

Definition at line 101 of file DDModEvent.h.


Constructor & Destructor Documentation

casa::DDModEvent::DDModEvent ( DisplayData dd,
const Record rec 
)

Constructor, taking a pointer to a DisplayData and a pointer to a data record.

virtual casa::DDModEvent::~DDModEvent ( ) [virtual]

Destructor.

(Required) default constructor.

casa::DDModEvent::DDModEvent ( const DDModEvent other) [protected]

(Required) copy constructor.


Member Function Documentation

virtual const Record* casa::DDModEvent::dataRecord ( ) const [inline, virtual]

Return a pointer to the data record.

Definition at line 113 of file DDModEvent.h.

References itsRec.

DDModEvent& casa::DDModEvent::operator= ( const DDModEvent other) [protected]

(Required) copy assignment.


Member Data Documentation

const Record* casa::DDModEvent::itsRec [private]

the data record

Definition at line 130 of file DDModEvent.h.

Referenced by dataRecord().


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