Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

PropertyEvent Class Reference

PropertyEvents are passed to PropertyListener objectss to notify them of changes to the properties they are listening to. More...

#include <vos/metaobjects/property/propertylistener.hh>

Inheritance diagram for PropertyEvent:

RefCounted List of all members.

Public Types

Public Member Functions


Detailed Description

PropertyEvents are passed to PropertyListener objectss to notify them of changes to the properties they are listening to.

Create a subclass and override notifyPropertyChanged, create an instance, and then use Property::addPropertyListener to register your listener with that property.

Definition at line 37 of file propertylistener.hh.


Member Enumeration Documentation

enum PropertyEvent::EventType
 

Enumeration values:
PropertyWrite 
PropertyReplace 
PropertyRead 

Definition at line 40 of file propertylistener.hh.


Constructor & Destructor Documentation

PropertyEvent::PropertyEvent EventType  et,
Vobject &  init,
Property property,
const string &  value,
const string &  datatype,
bool  isACcheck
 

Definition at line 34 of file propertylistener.cc.

PropertyEvent::PropertyEvent EventType  et,
Vobject &  init,
Property property,
const string &  value,
const string &  datatype,
const string &  oldvalue,
const string &  olddatatype,
bool  isACcheck
 

Definition at line 53 of file propertylistener.cc.

PropertyEvent::PropertyEvent EventType  et,
Vobject &  init,
Property property,
int  offset,
int  length,
const string &  value,
const string &  datatype,
bool  isACcheck
 

Definition at line 71 of file propertylistener.cc.

PropertyEvent::PropertyEvent EventType  et,
Vobject &  init,
Property property,
int  offset,
int  length,
const string &  value,
const string &  datatype,
const string &  oldvalue,
const string &  olddatatype,
bool  isACcheck
 

Definition at line 91 of file propertylistener.cc.

PropertyEvent::~PropertyEvent  )  [virtual]
 

Definition at line 110 of file propertylistener.cc.


Member Function Documentation

const string& PropertyEvent::getDataType  )  const [inline]
 

Returns:
For an access control check, this is the old property datatype (the change has not been commited yet). For a notify event it is the current datatype of the property.

Definition at line 153 of file propertylistener.hh.

EventType PropertyEvent::getEvent  )  const [inline]
 

Returns:
What type of event this is.

Definition at line 83 of file propertylistener.hh.

Referenced by LocalProperty::validatePropertyAccess().

Vobject* PropertyEvent::getInitiator  )  const [inline]
 

Returns:
The object which requested or initiated this event. Always valid. For access control checks, this is the object which is requesting access. Note that unlike most parts of the API the reference count on the returned object is NOT increased (acquire is NOT called) so if you plan on keeping a reference to it past the lifetime of the callback, you must call acquire yourself! This also means you should NOT assign the returned value to a vRef!

Definition at line 94 of file propertylistener.hh.

unsigned int PropertyEvent::getLength  )  const [inline]
 

Returns:
The size of the changed section.

Definition at line 117 of file propertylistener.hh.

const string& PropertyEvent::getNewDataType  )  const [inline]
 

Returns:
For an access control check, this is the proposed new datatype (it has not been commited yet). For a notify event, the new datatype for this property.

Definition at line 148 of file propertylistener.hh.

Referenced by PropertyListenerSiteWrapper::notifyPropertyChange().

const string& PropertyEvent::getNewValue  )  const [inline]
 

Returns:
For an access control check, this is the proposed new value (it has not been commited yet). For a notify event, the new value for this property.

Definition at line 127 of file propertylistener.hh.

Referenced by PropertyListenerSiteWrapper::notifyPropertyChange().

unsigned int PropertyEvent::getOffset  )  const [inline]
 

Returns:
The beginning of the changed section.
Note:
If you want to know what exactly section of the property changed on a write event, use
string section = e.getNewValue().substr(e.getOffset(), e.getLength());

Definition at line 114 of file propertylistener.hh.

const string& PropertyEvent::getOldDataType  )  const [inline]
 

Returns:
The previous datatype of this property, prior to a proposed change (for access control checks) or prior to the most recent change (for notify events).

Definition at line 143 of file propertylistener.hh.

const string& PropertyEvent::getOldValue  )  const [inline]
 

Returns:
The previous value of this property, prior to a proposed change (for access control checks) or prior to the most recent change (for notify events).

Definition at line 122 of file propertylistener.hh.

Property* PropertyEvent::getProperty  )  const [inline]
 

Returns:
The property which is being accessed or changed. Always valid. For access control checks, this is the object which is requesting access. Note that unlike most parts of the API the reference count on the returned object is NOT increased (acquire is NOT called) so if you plan on keeping a reference to it past the lifetime of the callback, you must call acquire yourself! This also means you should NOT assign the returned value to a vRef!

Definition at line 105 of file propertylistener.hh.

Referenced by PropertyListenerSiteWrapper::notifyPropertyChange(), and LocalProperty::validatePropertyAccess().

const string& PropertyEvent::getValue  )  const [inline]
 

Returns:
For an access control check, this is the old property value (the change has not been commited yet). For a notify event it is the current value of the property.

Definition at line 132 of file propertylistener.hh.

void PropertyEvent::setNewDataType const string &  dt  )  [inline]
 

Only to be used for access control checks.

This allows you to modify the proposed new datatype for this property.

Parameters:
dt the new datatype to use

Definition at line 159 of file propertylistener.hh.

void PropertyEvent::setNewValue const string &  v  )  [inline]
 

Only to be used for access control checks.

This allows you to modify the proposed new value for this property.

Parameters:
v the new value to use

Definition at line 138 of file propertylistener.hh.


The documentation for this class was generated from the following files:
Generated on Tue Aug 12 03:55:56 2003 for Interreality Project - VOS by doxygen 1.3.2