summaryrefslogtreecommitdiff
path: root/src/output.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-10 15:57:34 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-10 15:57:34 -0400
commitaf3be5f96463bcba6ddf4cd26e2ead9d925287b1 (patch)
tree978fa8867503368a3e9072ec20fae48845328097 /src/output.h
parentbedadd03a0a8ec4b84751104139cc49bede72cbe (diff)
downloadfork-ledger-af3be5f96463bcba6ddf4cd26e2ead9d925287b1.tar.gz
fork-ledger-af3be5f96463bcba6ddf4cd26e2ead9d925287b1.tar.bz2
fork-ledger-af3be5f96463bcba6ddf4cd26e2ead9d925287b1.zip
Wrote the beginnings of a new "stats" command.
Diffstat (limited to 'src/output.h')
-rw-r--r--src/output.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/output.h b/src/output.h
index fd462040..ada7b21c 100644
--- a/src/output.h
+++ b/src/output.h
@@ -83,6 +83,41 @@ public:
*
* Long.
*/
+class gather_statistics : public item_handler<xact_t>
+{
+protected:
+ report_t& report;
+ entry_t * last_entry;
+ xact_t * last_xact;
+
+ struct statistics_t {
+ std::size_t total_entries;
+ std::size_t total_xacts;
+
+ statistics_t()
+ : total_entries(0),
+ total_xacts(0) {}
+ }
+ statistics;
+
+public:
+ gather_statistics(report_t& _report)
+ : report(_report), last_entry(NULL), last_xact(NULL) {
+ TRACE_CTOR(gather_statistics, "report&");
+ }
+ virtual ~gather_statistics() {
+ TRACE_DTOR(gather_statistics);
+ }
+
+ virtual void flush();
+ virtual void operator()(xact_t& xact);
+};
+
+/**
+ * @brief Brief
+ *
+ * Long.
+ */
class format_entries : public format_xacts
{
public: