]> git.stg.codes - stg.git/blobdiff - include/stg/user_traff.h
Merge branch 'stg-2.409'
[stg.git] / include / stg / user_traff.h
index 1b9e2035ce9e8466457bf4c2857ff61cf1451367..8ef8e2608f8d3f2f569a7bb8cd4800e57a739b7b 100644 (file)
@@ -51,6 +51,12 @@ public:
     uint64_t & operator[](IndexType idx) { return traff[idx]; }
     IndexType size() const { return traff.size(); }
 
+    void Reset()
+    {
+    for (IndexType i = 0; i < traff.size(); ++i)
+        traff[i] = 0;
+    }
+
 private:
     ContainerType traff;
 };
@@ -74,6 +80,7 @@ return o;
 class DIR_TRAFF_RES
 {
 public:
+    typedef RESETABLE<uint64_t> value_type;
     typedef RESETABLE<uint64_t> ValueType;
     typedef std::vector<ValueType> ContainerType;
     typedef ContainerType::size_type IndexType;
@@ -87,6 +94,7 @@ public:
     }
     const ValueType & operator[](IndexType idx) const { return traff[idx]; }
     ValueType & operator[](IndexType idx) { return traff[idx]; }
+    IndexType size() const { return traff.size(); }
     DIR_TRAFF GetData() const
     {
     DIR_TRAFF res;