When you use Watch & Notify, POET calls your Notify() function, passing it a pointer to a PtObjectNote which describes the event which occurred. This class will tell you which objects were involved in the event and what happened with those objects. Depending on your operating system, the Notify() function may be called in an exception, so you should be careful not to do anything which is not allowed in an exception on your system. PtObjectNote contains a number of members, each of which can tell you something about the event that happened.
Files to include | Class declaration | Base class |
poet.hxx | ptinfo.hxx | PtNote |
constructor | PtObjectNote(PtOnDemand& , PtOnDemand& , PtWatchMode, PtDepthMode, PtLockMode); |
destructor | ~PtObjectNote(); |
action | PtWatchMode action; |
depth | PtDepthMode depth; |
mode | PtLockMode mode; |
object | PtOnDemand object; |
rootobject | PtOnDemand rootobject; |
- PtObjectNote::PtObjectNote() PtObjectNote::PtObjectNote(PtOnDemand&,PtOnDemand&, PtWatchMode, PtDepthMode,PtLockMode)
Constructors. You will not normally create a PtObjectNote; POET creates one and passes it to your Notify() function. After your Notify() function is finished, POET deletes the PtObjectNote.
- PtObjectNote::~PtObjectNote()
Destructor. You will not normally delete a PtObjectNote, this is POET's responsibility.
The action which triggered the watch. This is a constant defined in ptconst.hxx:
PtWATCH_NONE = 0x0000; PtWATCH_STORE = 0x0001; PtWATCH_UPDATE = 0x0003; PtWATCH_DELETE = 0x0004; PtWATCH_INSERT = 0x0008; PtWATCH_LOCK = 0x0010; PtWATCH_UNLOCK = 0x0020;
This member is used for lock and unlock events to report the depth mode of the lock. It is not used for other events.
If the action was a lock or an unlock, this is the lock mode for the action which occurred. This is a constant defined in PTCONST.HXX:
PtLK_NONE PtLK_READvDELETE PtLK_READvWRITE PtLK_WRITEvWRITE PtLK_DELETEvWRITE PtLK_DELETEvREAD PtLK_EXCLUSIVE
The event involved this object. Something happened to this object to trigger the watch. For instance, if you set a PtWATCH_STORE watch this might be the object which was stored.
You may read this object using PtOnDemand:: Get(). Depending on your operating system, the Notify() function may be called in an exception, so you should be careful not to do anything which is not allowed in an exception on your system.
This is the object which actually set the watch. If the depth mode for the watch was PtFLAT, then object and rootobject are the same. Otherwise, rootobject will be different from object if the event actually happened to a referenced object instead of to the object that set the watch. You may read this object using PtOnDemand:: Get(). If you set the watch using PtObjectSet:: Watch() then there is no root object, and the ondemand is set to null.
Depending on your operating system, the Notify() function may be called in an exception, so you should be careful not to do anything which is not allowed in an exception on your system.
Copyright (c) 1996 POET Software, Inc. All rights reserved. Reproduction in whole or in part in any form or medium without the express permission of POET Software, Inc. is prohibited.