- friend std::ostream & operator<< (std::ostream & o, const DIR_TRAFF & traff);
-
-public:
- typedef std::vector<uint64_t> ContainerType;
- typedef ContainerType::size_type IndexType;
-
- DIR_TRAFF() {}
- DIR_TRAFF(const DIR_TRAFF & ts) : traff(ts.traff) {}
- DIR_TRAFF & operator=(const DIR_TRAFF & ts) { traff = ts.traff; return *this; }
- const uint64_t & operator[](IndexType idx) const { return traff[idx]; }
- uint64_t & operator[](IndexType idx) { return traff[idx]; }
- DIR_TRAFF operator+(const DIR_TRAFF & ts);
- IndexType size() const { return traff.size(); }
-
-private:
- ContainerType traff;
+ friend std::ostream& operator<< (std::ostream& stream, const DirTraff& traff);
+
+ public:
+ using ContainerType = std::vector<uint64_t>;
+ using IndexType = ContainerType::size_type;
+
+ DirTraff() noexcept : traff(DIR_NUM) {}
+ const uint64_t & operator[](IndexType idx) const noexcept { return traff[idx]; }
+ uint64_t & operator[](IndexType idx) noexcept { return traff[idx]; }
+ IndexType size() const noexcept { return traff.size(); }
+
+ void reset() noexcept
+ {
+ for (IndexType i = 0; i < traff.size(); ++i)
+ traff[i] = 0;
+ }
+
+ private:
+ ContainerType traff;