42 #ifndef SENSOR_FACTORY_HPP 43 #define SENSOR_FACTORY_HPP 49 #include "../../../util/log/easylogging++.h" 51 #include "../../../util/error/kallisto_error.hpp" 52 #include "../../../util/executor/executor.hpp" 53 #include "../../../bluetooth/device/bluetooth_dispatcher.hpp" 54 #include "../synchronization/time_synchronizer.hpp" 64 std::vector<std::unique_ptr<SensorProvider>> m_providers;
71 m_providers = std::vector<std::unique_ptr<SensorProvider>>();
87 for(
auto it = m_providers.begin(); it != m_providers.end(); it++){
92 m_providers.push_back(std::move(provider));
102 for(
auto it = m_providers.begin(); it != m_providers.end(); it++){
104 m_providers.erase(it);
123 std::vector<std::unique_ptr<SensorImpl> >
build(
Kallisto&
kallisto,
const std::map<std::string, std::vector<uint8_t>>& service_data,
124 const std::map<uint16_t, std::vector<uint8_t> >& manufacturer_data,
util::Executor& event_dispatcher,
126 std::vector<std::unique_ptr<SensorImpl> > sensor_list = std::vector<std::unique_ptr<SensorImpl> >();
128 for(
auto it1 = m_providers.begin(); it1 != m_providers.end(); it1++){
129 std::vector<std::unique_ptr<SensorImpl> > list = (*it1)->provide(kallisto, service_data, manufacturer_data, event_dispatcher, bluetooth_dispatcher, sensor_synchonizer);
131 for(
auto it2 = list.begin(); it2 != list.end(); it2++){
132 sensor_list.push_back(std::move(*it2));
143 #endif // SENSOR_FACTORY_HPP static KallistoDetailedResult build(const KallistoResult result)
error::KallistoDetailedResult unregisterProvider(std::unique_ptr< SensorProvider > provider)
Definition: sensor_factory.hpp:100
Definition: time_synchronizer.hpp:56
Definition: bluetooth_adapter.hpp:52
Class that encapsulates a result.
Definition: kallisto_error.hpp:81
Definition: bluetooth_dispatcher.hpp:57
Definition: kallisto.hpp:52
Definition: executor.hpp:71
Definition: sensor_factory.hpp:60
SensorFactory()
Definition: sensor_factory.hpp:69
~SensorFactory()
Definition: sensor_factory.hpp:76
error::KallistoDetailedResult registerProvider(std::unique_ptr< SensorProvider > provider)
Definition: sensor_factory.hpp:85
std::vector< std::unique_ptr< SensorImpl > > build(Kallisto &kallisto, const std::map< std::string, std::vector< uint8_t >> &service_data, const std::map< uint16_t, std::vector< uint8_t > > &manufacturer_data, util::Executor &event_dispatcher, bluetooth::BluetoothDispatcher &bluetooth_dispatcher, TimeSynchronizer &sensor_synchonizer)
Definition: sensor_factory.hpp:122