2016-06-15 23:48:41 +02:00
|
|
|
#ifndef HEALTHTABLE_H_
|
|
|
|
#define HEALTHTABLE_H_
|
|
|
|
|
2020-08-13 20:53:35 +02:00
|
|
|
#include "HealthTableIF.h"
|
|
|
|
#include "../objectmanager/SystemObject.h"
|
|
|
|
#include "../ipc/MutexIF.h"
|
2016-06-15 23:48:41 +02:00
|
|
|
#include <map>
|
|
|
|
|
|
|
|
typedef std::map<object_id_t, HasHealthIF::HealthState> HealthMap;
|
|
|
|
|
|
|
|
class HealthTable: public HealthTableIF, public SystemObject {
|
|
|
|
public:
|
|
|
|
HealthTable(object_id_t objectid);
|
|
|
|
virtual ~HealthTable();
|
|
|
|
|
|
|
|
virtual ReturnValue_t registerObject(object_id_t object,
|
|
|
|
HasHealthIF::HealthState initilialState = HasHealthIF::HEALTHY);
|
|
|
|
|
|
|
|
virtual bool hasHealth(object_id_t object);
|
|
|
|
virtual void setHealth(object_id_t object, HasHealthIF::HealthState newState);
|
|
|
|
virtual HasHealthIF::HealthState getHealth(object_id_t);
|
|
|
|
|
|
|
|
virtual uint32_t getPrintSize();
|
2020-04-21 22:28:43 +02:00
|
|
|
virtual void printAll(uint8_t *pointer, size_t maxSize);
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
protected:
|
2018-07-12 16:29:32 +02:00
|
|
|
MutexIF* mutex;
|
2016-06-15 23:48:41 +02:00
|
|
|
HealthMap healthMap;
|
|
|
|
|
|
|
|
HealthMap::iterator mapIterator;
|
|
|
|
|
|
|
|
virtual ReturnValue_t iterate(std::pair<object_id_t,HasHealthIF::HealthState> *value, bool reset = false);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* HEALTHTABLE_H_ */
|