Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
ITASimulationScheduler
Commits
86f82fd6
Commit
86f82fd6
authored
Jun 05, 2020
by
Pascal Palenda
Browse files
Better define default behaviour
parent
29dad0a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/ITA/simulation_scheduler/audibility_filter/audibility_filter_interface.h
View file @
86f82fd6
...
...
@@ -55,11 +55,10 @@ namespace ITA
/// A filter might have a condition that has to be fulfilled to be actually useful.
/// Another filter might just be a conditional filter.
/// This function should handle both of these cases.
/// \note Default behaviour it to return true
;
/// \note Default behaviour it to return true
if \p previousState was created before \p newUpdate.
/// \param previousState the previous state of the scene to check against.
/// \param newUpdate the CUpdateScene to check.
/// \return true if the condition is fulfilled, else false.
/// \todo Check time stamps that this function was used correctly.
///
virtual
bool
conditionFulfilled
(
const
CUpdateScene
&
previousState
,
const
CUpdateScene
&
newUpdate
);
...
...
@@ -68,11 +67,10 @@ namespace ITA
/// \brief Check if the change between \p previousState and \p newUpdate is audible.
///
/// This function might call ::conditionFulfilled to check if the condition for its test is fulfilled.
/// \note Default behaviour it to return t
rue;
/// \note Default behaviour it to return t
he result of conditionFulfilled.
/// \param previousState the previous state of the scene to check against.
/// \param newUpdate the CUpdateScene to check for audibility.
/// \return true if the change between \p previousState and \p newUpdate is audible, else false.
/// \todo Check time stamps that this function was used correctly.
///
virtual
bool
changeIsAudible
(
const
CUpdateScene
&
previousState
,
const
CUpdateScene
&
newUpdate
);
};
...
...
src/ITA/simulation_scheduler/audibility_filter/audibility_filter_interface.cpp
View file @
86f82fd6
#include <ITA/simulation_scheduler/audibility_filter/audibility_filter_interface.h>
// simulation scheduler includes
#include <ITA/simulation_scheduler/update_scene.h>
namespace
ITA
{
namespace
simulation_scheduler
...
...
@@ -9,18 +12,17 @@ namespace ITA
std
::
map
<
std
::
string
,
CAudibilityFilterFactory
::
CreateCallback
>
CAudibilityFilterFactory
::
m_mFilters
;
// Definition of the pure virtual destructor.
IAudibilityFilter
::~
IAudibilityFilter
()
{
}
IAudibilityFilter
::~
IAudibilityFilter
(
)
{
}
bool
IAudibilityFilter
::
conditionFulfilled
(
const
CUpdateScene
&
previousState
,
const
CUpdateScene
&
newUpdate
)
bool
IAudibilityFilter
::
conditionFulfilled
(
const
CUpdateScene
&
previousState
,
const
CUpdateScene
&
newUpdate
)
{
return
true
;
return
previousState
.
getTimeStamp
(
)
<
newUpdate
.
getTimeStamp
(
)
;
}
bool
IAudibilityFilter
::
changeIsAudible
(
const
CUpdateScene
&
previousState
,
const
CUpdateScene
&
newUpdate
)
bool
IAudibilityFilter
::
changeIsAudible
(
const
CUpdateScene
&
previousState
,
const
CUpdateScene
&
newUpdate
)
{
return
true
;
return
conditionFulfilled
(
previousState
,
newUpdate
)
;
}
void
CAudibilityFilterFactory
::
registerFilter
(
const
std
::
string
&
type
,
CreateCallback
createFunction
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment