clover/embedded/lib/Component/MainComponent.hpp
2023-12-22 14:28:34 +01:00

56 lines
No EOL
1.1 KiB
C++

#ifndef _HEADER_COMPONENT_MAIN
#define _HEADER_COMPONENT_MAIN
#include "Component.hpp"
#include "LedComponent.hpp"
#include "DHTComponent.hpp"
class MainComponent {
public:
// Singleton
static MainComponent& GetInstance()
{
static MainComponent instance;
return instance;
}
// Public functions
/**
* @brief create all the instanciations of the component
*/
void setup();
/**
* @brief Get the Humidity object reference
*
* @return Component&
*/
Component& getHumidity();
/**
* @brief Get the Led object reference
*
* @return LedComponent&
*/
LedComponent& getLed();
/**
* @brief Get the DHT object reference
*
* @return DHTComponent&
*/
DHTComponent& getDHT();
private:
// Singleton
MainComponent();
~MainComponent();
MainComponent(const MainComponent&) = delete;
MainComponent& operator=(const MainComponent&) = delete;
// Components
Component _humidity;
LedComponent _led;
DHTComponent _dht;
};
#endif //