Add macro for sub sensor defining (#4315)

This commit is contained in:
Jesse Hills 2023-01-19 17:36:43 +13:00 committed by GitHub
parent e4ca3b18cc
commit f2eafa8fbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,13 @@ namespace sensor {
} \
}
#define SUB_SENSOR(name) \
protected: \
sensor::Sensor *name##_sensor_{nullptr}; \
\
public: \
void set_##name##_sensor(sensor::Sensor *sensor) { this->name##_sensor_ = sensor; }
/**
* Sensor state classes
*/