casa
$Rev:20696$
|
Class used by DisplayDatas to signal change in data. More...
#include <DDModEvent.h>
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 Record * | dataRecord () const |
Return a pointer to the data record. | |
Protected Member Functions | |
DDModEvent () | |
(Required) default constructor. | |
DDModEvent (const DDModEvent &other) | |
(Required) copy constructor. | |
DDModEvent & | operator= (const DDModEvent &other) |
(Required) copy assignment. | |
Private Attributes | |
const Record * | itsRec |
the data record |
Class used by DisplayDatas to signal change in data.
Internal
"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.
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
// 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! } } }
It's desirable to send some data with DisplayDataEvents that has information about the DisplayData and the data that is modified within it.
.
Definition at line 101 of file DDModEvent.h.
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.
casa::DDModEvent::DDModEvent | ( | ) | [protected] |
(Required) default constructor.
casa::DDModEvent::DDModEvent | ( | const DDModEvent & | other | ) | [protected] |
(Required) copy constructor.
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.
const Record* casa::DDModEvent::itsRec [private] |