Commit 68f48e64 authored by Pascal Palenda's avatar Pascal Palenda
Browse files

More renaming for filter condition

parent 64f114da
......@@ -5,7 +5,7 @@
#include <ITA/simulation_scheduler/definitions.h>
// simulation scheduler includes
#include <ITA/simulation_scheduler/audibility_filter/condition_filter_interface.h>
#include <ITA/simulation_scheduler/audibility_filter/filter_condition_interface.h>
// std includes
#include <memory>
......@@ -65,7 +65,7 @@ namespace ITA
/// \param vFilterConfig all filter to add to the config.
/// \todo Do we set or add filter configs? If we set, do we overwrite?
///
void setConditionFilterConfig ( const std::vector<IConditionFilter::ConditionFilterConfig>& vFilterConfig );
void setConditionFilterConfig ( const std::vector<IFilterCondition::FilterConditionConfig>& vFilterConfig );
///
/// \brief Get all condition filter configs from the AudibilityFilterConfig.
......@@ -73,7 +73,7 @@ namespace ITA
/// The order in which the condition filters were set in the config is also represented in the vector.
/// \return a vector with all condition filter configs.
///
std::vector<IConditionFilter::ConditionFilterConfig> getConditionFilterConfig ( ) const;
std::vector<IFilterCondition::FilterConditionConfig> getConditionFilterConfig ( ) const;
};
///
......@@ -117,7 +117,7 @@ namespace ITA
///
/// \brief Vector of the condition filters belonging to IAudibilityFilter.
///
std::vector<std::unique_ptr<IConditionFilter>> m_lpConditionFilters;
std::vector<std::unique_ptr<IFilterCondition>> m_lpConditionFilters;
};
///
......
......@@ -13,7 +13,7 @@ namespace ITA
{
std::map<std::string, CAudibilityFilterFactory::CreateCallback> CAudibilityFilterFactory::m_mFilters;
class CDefaultConditionFilter : public IConditionFilter
class CDefaultConditionFilter : public IFilterCondition
{
};
......@@ -29,7 +29,7 @@ namespace ITA
}
void IAudibilityFilter::AudibilityFilterConfig::setConditionFilterConfig (
const std::vector<IConditionFilter::ConditionFilterConfig>& vFilterConfig )
const std::vector<IFilterCondition::FilterConditionConfig>& vFilterConfig )
{
// We expect only one item in the given config -> One sublist with the config.
// Thus begin points to the expected config.
......@@ -64,7 +64,7 @@ namespace ITA
ITA_EXCEPT_INVALID_PARAMETER ( "Config is not a compatible audibility filter config." );
}
std::vector<IConditionFilter::ConditionFilterConfig> IAudibilityFilter::AudibilityFilterConfig::
std::vector<IFilterCondition::FilterConditionConfig> IAudibilityFilter::AudibilityFilterConfig::
getConditionFilterConfig ( ) const
{
if ( size ( ) == 1 )
......@@ -77,13 +77,13 @@ namespace ITA
const auto filterOrder = audibilityFilterConfig.GetSubListConstRef ( Properties::getConditionFilterOrderKey_Section ( ) );
std::vector<IConditionFilter::ConditionFilterConfig> configs;
std::vector<IFilterCondition::FilterConditionConfig> configs;
for ( int i = 0; i < filterOrder.size ( ); ++i )
{
auto filterName = filterOrder.GetValue<std::string> ( std::to_string ( i ) );
IConditionFilter::ConditionFilterConfig filterConfig;
IFilterCondition::FilterConditionConfig filterConfig;
filterConfig.SetPropertyListValue ( filterName, filterConfigs.GetSubListCopy ( filterName ) );
......@@ -93,7 +93,7 @@ namespace ITA
return configs;
}
else
return std::vector<IConditionFilter::ConditionFilterConfig> ( );
return std::vector<IFilterCondition::FilterConditionConfig> ( );
}
else
ITA_EXCEPT_INVALID_PARAMETER ( "Config is not a compatible audibility filter config." );
......@@ -111,7 +111,7 @@ namespace ITA
{
for ( const auto conditionConfig : lConditionFilterConfigs )
{
m_lpConditionFilters.push_back ( CConditionFilterFactory::createFilter ( conditionConfig ) );
m_lpConditionFilters.push_back ( CFilterConditionFactory::createFilter ( conditionConfig ) );
}
}
}
......
#include <ITA/simulation_scheduler/audibility_filter/condition_filter_interface.h>
#include <ITA/simulation_scheduler/audibility_filter/filter_condition_interface.h>
// simulation scheduler includes
#include <ITA/simulation_scheduler/update_scene.h>
......@@ -9,28 +9,28 @@ namespace ITA
{
namespace audibility_filter
{
std::map<std::string, CConditionFilterFactory::CreateCallback> CConditionFilterFactory::m_mFilters;
std::map<std::string, CFilterConditionFactory::CreateCallback> CFilterConditionFactory::m_mFilters;
// Definition of the pure virtual destructor.
IConditionFilter::~IConditionFilter ( )
IFilterCondition::~IFilterCondition ( )
{ }
bool IConditionFilter::conditionFulfilled ( const CUpdateScene& previousState, const CUpdateScene& newUpdate )
bool IFilterCondition::conditionFulfilled ( const CUpdateScene& previousState, const CUpdateScene& newUpdate )
{
return previousState.getTimeStamp ( ) < newUpdate.getTimeStamp ( );
}
void CConditionFilterFactory::registerFilter ( const std::string& type, CreateCallback createFunction )
void CFilterConditionFactory::registerFilter ( const std::string& type, CreateCallback createFunction )
{
m_mFilters [type] = createFunction;
}
void CConditionFilterFactory::unregisterFilter ( const std::string& type )
void CFilterConditionFactory::unregisterFilter ( const std::string& type )
{
m_mFilters.erase ( type );
}
std::unique_ptr<IConditionFilter> CConditionFilterFactory::createFilter ( const IConditionFilter::ConditionFilterConfig& pConfig )
std::unique_ptr<IFilterCondition> CFilterConditionFactory::createFilter ( const IFilterCondition::FilterConditionConfig& pConfig )
{
auto it = m_mFilters.find ( pConfig.begin ( )->first );
if ( it != m_mFilters.end ( ) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment