17 #ifndef ZORBA_AUDIT_SCOPED_H
18 #define ZORBA_AUDIT_SCOPED_H
32 : theEvent(event ? event :
Event::get()),
39 theEvent->submitRecord(theRecord);
50 theRecord = theEvent->createRecord();
66 : theRecord(record), theProperty(prop), theValue(value) {
68 if (theNeedToAuditFlag) {
75 theProperty(*record.getEvent()->getDynamicProperty(prop_name)),
78 if (theNeedToAuditFlag) {
88 if (theNeedToAuditFlag) {
91 theNeedToAuditFlag =
false;
97 ScopedAuditor(
const ScopedAuditor&) {}
99 ScopedRecord& theRecord;
100 const Property& theProperty;
101 bool theNeedToAuditFlag;
144 static inline void start(value_type& value) {
146 static inline audit_type
end(value_type& value) {
147 return static_cast<audit_type
>(value);
151 template<>
struct AuditorTraits< std::pair<std::streampos, std::istream*> > {
155 value.first = value.second->tellg();
158 return value.second->tellg() - value.first;
162 template<>
struct AuditorTraits< std::pair<std::streampos, std::ostream*> > {
166 value.first = value.second->tellp();
169 return value.second->tellp() - value.first;