00001
00002
00003
00004
00005 #ifndef MEDIDA_COUNTER_H_
00006 #define MEDIDA_COUNTER_H_
00007
00008 #include <cstdint>
00009 #include <memory>
00010
00011 #include "medida/metric_interface.h"
00012
00013 namespace medida {
00014
00015 class Counter : public MetricInterface {
00016 public:
00017 Counter(std::int64_t init = 0);
00018 ~Counter();
00019 void Process(MetricProcessor& processor);
00020 std::int64_t count() const;
00021 void set_count(std::int64_t n);
00022 void inc(std::int64_t n = 1);
00023 void dec(std::int64_t n = 1);
00024 void clear();
00025 private:
00026 class Impl;
00027 std::unique_ptr<Impl> impl_;
00028 };
00029
00030 }
00031
00032 #endif // MEDIDA_COUNTER_H_