MonitoringStrategy
Diff: src/monitoringContext.cpp
- Revision:
- 0:7b63a9dd265c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/monitoringContext.cpp Fri May 07 13:49:51 2021 +0000 @@ -0,0 +1,26 @@ +#include "monitoringContext.h" + +MonitoringContext::MonitoringContext(MonitoringStrategyIf* strategy) +{ + m_strategy = strategy; +} + +MonitoringContext::~MonitoringContext() +{ + delete[] m_strategy; +} + +bool MonitoringContext::executePresenceCheck(const std:: map<float, float>& distancesMap, ObjectPosition* objectPosition) +{ + if(this->m_strategy->presenceCheck(distancesMap, objectPosition)) { + return true; + } + return false; +} + +void MonitoringContext::setMonitoringStrategy(MonitoringStrategyIf* strategy) +{ + delete this->m_strategy; + this->m_strategy = m_strategy; +} +