+ public:
+ using ValueType = std::optional<uint64_t>;
+ using ContainerType = std::vector<ValueType>;
+ using IndexType = ContainerType::size_type;
+
+ DirTraffOpt() noexcept: traff(DIR_NUM) {}
+ explicit DirTraffOpt(const DirTraff & ts) noexcept
+ : traff(ts.size())
+ {
+ for (IndexType i = 0; i < ts.size(); ++i)
+ traff[i] = ts[i];
+ }
+ DirTraffOpt& operator=(const DirTraff& ts) noexcept
+ {
+ for (IndexType i = 0; i < ts.size(); ++i)
+ traff[i] = ts[i];
+ return *this;
+ }
+ const ValueType & operator[](IndexType idx) const noexcept { return traff[idx]; }
+ ValueType & operator[](IndexType idx) noexcept { return traff[idx]; }
+ IndexType size() const noexcept { return traff.size(); }
+
+ private:
+ ContainerType traff;
+};
+