33 #ifndef EMANESTATISTICTABLE_HEADER_ 34 #define EMANESTATISTICTABLE_HEADER_ 40 #include <unordered_map> 45 class StatisticRegistrar;
59 template<
typename Key,
60 typename Compare = std::less<EMANE::Any>,
61 std::size_t sortIndex = 0>
81 std::size_t columnIndex,
94 void setRow(
const Key & key,
95 const std::vector<Any> & anys);
106 void addRow(
const Key & key,
107 const std::vector<Any> & anys = {});
121 void clear()
override;
124 using InternalTable = std::unordered_map<Key,std::vector<Any>>;
125 InternalTable table_;
126 mutable std::mutex mutex_;
128 std::function<void()> clearFunc_;
132 template <
typename Function>
142 #endif // EMANESTATISTICTABLE_HEADER_ StatisticTableLabels getLabels() const override
A two dimentional statistic table that holds Any values.
std::vector< std::vector< Any > > StatisticTableValues
A StatisticTablePublisher produces two dimensional tables of Anys.
void setCell(const Key &key, std::size_t columnIndex, const Any &any)
StatisticTableValues getValues() const override
void setRow(const Key &key, const std::vector< Any > &anys)
The StatisticRegistrar allows NEM layers to register statistics and statistic tables. Statistics and Statistic tables are owned by the emulator framework and a borrowed reference is returned to the registering NEM layer.
std::vector< std::string > StatisticTableLabels
void addRow(const Key &key, const std::vector< Any > &anys={})
void deleteRow(const Key &key)
The Any class can contain an instance of one of any type in its support type set. ...