The postread and prewrite methods are specialized EDM methods that should be used with care. postread() is called after all objects in an event are read in and before the event is visible to the user. prewrite() is called just before writing an event. One cannot perform arbitrary operations in postread() and prewrite(), however. postread is supposed to be used to restore the transient pointer in any Link or ConstLink data members. It should return true if the restoration succeeds. prewrite() is not generally used, and can simply return true.
public: virtual bool postread(EventRecord* p_record) ; public: virtual bool prewrite(EventRecord* p_record) ;
The use of these methods is under review. Various classes, as part of the development process, have relied upon these methods to perform CPU intensive object transformations. This overhead is forced upon every user reading/writing events containing these objects even if they are not of interest. In order to provide the user some control over what transformations are performed, these operations are being moved to Puffer and related AC++ modules.
In time, we hope to eliminate the need for postread() and prewrite() methods altogether. To do this, the EDM must provide Link/ConstLink classes which restores their transient pointer upon first use, and RefVectors which append their contents to the event as soon as the RefVector is appended, goals actively being pursued at this time.
Comments on this page may be sent to Rob Kennedy