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;
static audit_type end(value_type &value)
virtual bool audit(const Property &) const =0
const std::string value_type
static void start(value_type &value)
virtual void add(const Property &prop, long long val)=0
static audit_type end(value_type &value)
static void start(value_type &value)
an identifier for a specific piece of information that can be audited.
static audit_type end(value_type &value)
static audit_type end(value_type &value)
ScopedAuditor(ScopedRecord &record, const String &prop_name, T &value)
ScopedAuditor< zorba::time::Timer, 0x2 > MicroDurationAuditor
std::pair< std::streampos, std::istream * > value_type
static void start(value_type &value)
ScopedAuditor< const int > IntAuditor
time::msec_type getStart() const
static audit_type end(value_type &value)
static void start(value_type &value)
const std::string audit_type
ScopedAuditor< const std::string > StringAuditor
ScopedAuditor< zorba::time::Timer > DurationAuditor
ScopedAuditor(ScopedRecord &record, const Property &prop, T &value)
zorba::time::Timer value_type
static void start(value_type &value)
zorba::time::Timer value_type
static void start(value_type &value)
static void start(value_type &value)
std::pair< std::streampos, std::ostream * > value_type
static audit_type end(value_type &value)
ScopedAuditor< zorba::time::Timer, 0x1 > TimestampAuditor
static void start(value_type &value)
ScopedRecord(Event *event)
static audit_type end(value_type &value)
static void start(value_type &value)
zorba::time::Timer value_type
static audit_type end(value_type &value)
static audit_type end(value_type &value)