#pragma once #include #include #include namespace inaf::oasbo::PacketMonitors{ class BasePacketMonitor{ protected: std::map stats; public: virtual void monit(PacketLib::BasePacket &) = 0; virtual void printStats()=0; virtual void reset() = 0; virtual std::map getStatsMap() const { return stats;} std::optional getStat(std::string stat) const { try { return this->stats.at(stat); } catch (const std::out_of_range &) { return std::nullopt; } } virtual ~BasePacketMonitor() = default; }; }