Files
hardwaremoniter/hardware_monitor_wrapper/native/include/Visitor.h
2025-06-08 17:40:21 +08:00

37 lines
1.2 KiB
C++

#pragma once
#include "dll_macro.h"
#include "IComputer.h"
#include "Hardware.h"
class Sensor;
#include "Parameter.h"
struct innerVisitor;
class VisitorCallBacks;
typedef void (*VisitComputerDelegate)(IComputer& computer, Visitor* visitor);
typedef void (*VisitHardwareDelegate)(Hardware& hardware, Visitor* visitor);
typedef void (*VisitSensorDelegate)(Sensor& sensor, Visitor* visitor);
typedef void (*VisitParameterDelegate)(Parameter& parameter, Visitor* visitor);
class DLL_API Visitor {
public:
Visitor();
void setVisitComputerCallBack(VisitComputerDelegate);
void setVisitHardwareCallBack(VisitHardwareDelegate);
void setVisitSensorCallBack(VisitSensorDelegate);
void setVisitParameterCallBack(VisitParameterDelegate);
void commit();
VisitComputerDelegate getVisitComputerCallBack();
VisitHardwareDelegate getVisitHardwareCallBack();
VisitSensorDelegate getVisitSensorCallBack();
VisitParameterDelegate getVisitParameterCallBack();
innerVisitor* getInner();
protected:
innerVisitor* inner;
VisitComputerDelegate visitComputerCallBack;
VisitHardwareDelegate visitHardwareCallBack;
VisitSensorDelegate visitSensorCallBack;
VisitParameterDelegate visitParameterCallBack;
};