X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d7a542f962802ad207d823b7e805c9135c1693e3..c016156ebb870d9d81219b8c4165aa75703f1e85:/projects/stargazer/plugins/other/smux/tables.h diff --git a/projects/stargazer/plugins/other/smux/tables.h b/projects/stargazer/plugins/other/smux/tables.h new file mode 100644 index 00000000..ad3b55a3 --- /dev/null +++ b/projects/stargazer/plugins/other/smux/tables.h @@ -0,0 +1,38 @@ +#ifndef __TABLES_H__ +#define __TABLES_H__ + +#include +#include + +#include "sensors.h" + +class TableSensor { + public: + TableSensor(const std::string & p) : prefix(p) {} + virtual ~TableSensor() {} + + const std::string & GetPrefix() const { return prefix; } + virtual void UpdateSensors(Sensors & sensors) const = 0; + + protected: + std::string prefix; +}; + +class TariffUsersTable : public TableSensor { + public: + TariffUsersTable(const std::string & p, + USERS & u) + : TableSensor(p), + users(u) + {} + virtual ~TariffUsersTable() {} + + void UpdateSensors(Sensors & sensors) const; + + private: + USERS & users; +}; + +typedef std::map Tables; + +#endif