66 lines
1.5 KiB
C++
Executable File
66 lines
1.5 KiB
C++
Executable File
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "logger.h"
|
|
#include <InfrastructureManagement/ism_dtc.h>
|
|
#include <ComponentMonitor/cmo.hpp>
|
|
#include <QObject>
|
|
#include <memory>
|
|
|
|
namespace DDSConnector
|
|
{
|
|
class DdsConnector;
|
|
}
|
|
|
|
namespace ComponentMonitor
|
|
{
|
|
class DdsHandler;
|
|
|
|
|
|
|
|
class ComponentStatusHandler : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
using CONT_T = QMap<int, ComponentStatus>;
|
|
using ITERATOR_T = QMap<int, ComponentStatus>::iterator;
|
|
using CONST_ITERATOR_T = QMap<int, ComponentStatus>::ConstIterator;
|
|
|
|
public:
|
|
ComponentStatusHandler();
|
|
~ComponentStatusHandler();
|
|
|
|
bool initialize(const std::shared_ptr<DdsHandler> &ddsHandler);
|
|
|
|
long statusMapSize() const { return m_statusMap.size(); }
|
|
std::vector<std::string> getHostnames() const;
|
|
|
|
public Q_SLOTS:
|
|
void onNewState(const QString &hostname, bool reachable, long long lastCheckSec);
|
|
|
|
|
|
void onUpdateLastCheckTimeDirect(const QStringList &hostnamesForUpdateLastCheckTime, qint64 lastCheckSec);
|
|
|
|
private Q_SLOTS:
|
|
void onInstrumentationAssetChanged(const InfrastructureManagement::InstrumentationAsset &iAsset, DataModification dataMod);
|
|
|
|
void dump();
|
|
|
|
protected:
|
|
NGL::INGLLogger &m_logger;
|
|
bool addUpdateInstrumentationAsset(ITERATOR_T it, const ComponentStatus &cs);
|
|
bool removeInstrumentationAsset(ITERATOR_T it);
|
|
|
|
private:
|
|
std::shared_ptr<DdsHandler> m_ddsHandler;
|
|
|
|
std::shared_ptr<InfrastructureManagement::Interface::Dtc> m_ismDtc;
|
|
|
|
CONT_T m_statusMap;
|
|
};
|
|
|
|
|
|
}
|