Commit 0d393854 authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Change PostUpdate -> PushUpdate

parent 6194eb80
......@@ -88,7 +88,7 @@ int main ( )
update->SetSourceReceiverPair ( std::move ( source ),
std::move ( receiver ) );
masterController->PostUpdate ( std::move ( update ) );
masterController->PushUpdate ( std::move ( update ) );
// We need to wait a bit for the workers to start working
VistaTimeUtils::Sleep ( 500 );
......
......@@ -71,9 +71,9 @@ namespace ITA
bool IsBusy ( ) override;
///
/// \copydoc IWorkerInterface::postUpdate
/// \copydoc IWorkerInterface::PushUpdate
///
void PostUpdate ( std::unique_ptr<CUpdateScene> pUpdate ) override;
void PushUpdate ( std::unique_ptr<CUpdateScene> pUpdate ) override;
///
/// \copydoc IWorkerInterface::reset
......
......@@ -37,7 +37,7 @@ namespace ITA
///
/// This class represents the interface with which external software should interact with the simulation scheduler for room acoustic simulations.
/// It allows for easy interaction and configuration of the system.
/// - Updates can be issued via postUpdate().
/// - Updates can be issued via PushUpdate().
/// - A IResultHandler can be registered via attachResultHandler.
/// - A simple replacement filter can be enabled for the CMasterSimulationController.
///
......@@ -82,12 +82,12 @@ namespace ITA
~CMasterSimulationController ( );
///
/// \brief Post a new update to the CMasterSimulationController.
/// \brief Push a new update to the CMasterSimulationController.
///
/// \note This method takes ownership of the update.
/// \param pUpdateMessage the new update for the CMasterSimulationController.
///
void PostUpdate ( std::unique_ptr<IUpdateMessage> pUpdateMessage );
void PushUpdate ( std::unique_ptr<IUpdateMessage> pUpdateMessage );
///
/// \brief Attach a IResultHandler to the controller.
......@@ -166,7 +166,7 @@ namespace ITA
///
/// \brief Update queue for the controller.
///
/// postUpdate() adds new updates to this queue before they get passed to the schedulers in LoopBody().
/// PushUpdate() adds new updates to this queue before they get passed to the schedulers in LoopBody().
///
tbb::concurrent_queue<std::unique_ptr<IUpdateMessage>> m_qUpdateQueue;
......
......@@ -46,7 +46,7 @@ namespace ITA
/// This scheduler runs local to where it was created.
///
/// It allows for easy interaction and configuration of the system.
/// - Updates can be issued via postUpdate().
/// - Updates can be issued via PushUpdate().
/// - A IResultHandler can be registered via attachResultHandler.
/// - A simple replacement filter can be enabled for the CScheduler.
///
......@@ -97,9 +97,9 @@ namespace ITA
virtual ~CScheduler ( );
///
/// \copydoc ISchedulerInterface::postUpdate()
/// \copydoc ISchedulerInterface::PushUpdate()
///
virtual void PostUpdate ( std::unique_ptr<IUpdateMessage> pUpdateMessage ) override;
virtual void PushUpdate ( std::unique_ptr<IUpdateMessage> pUpdateMessage ) override;
///
/// \copydoc ISchedulerInterface::attachResultHandler()
......
......@@ -55,12 +55,12 @@ namespace ITA
virtual ~ISchedulerInterface ( ) = default;
///
/// \brief Post a new update to the scheduler.
/// \brief Push a new update to the scheduler.
///
/// \note This method takes ownership of the update.
/// \param pUpdateMessage the new update for the scheduler.
///
virtual void PostUpdate ( std::unique_ptr<IUpdateMessage> pUpdateMessage ) = 0;
virtual void PushUpdate ( std::unique_ptr<IUpdateMessage> pUpdateMessage ) = 0;
///
/// \brief Attach a IResultHandler to the scheduler.
......
......@@ -80,13 +80,13 @@ namespace ITA
virtual bool IsBusy ( ) = 0;
///
/// \brief Post a new update to the worker.
/// \brief Push a new update to the worker.
///
/// After a new Update is posted to a worker, the update gets simulated immediately.
/// After a new Update is pushed to a worker, the update gets simulated immediately.
/// \note This method takes ownership of the update.
/// \param pUpdateMessage the new update for the scheduler.
///
virtual void PostUpdate ( std::unique_ptr<CUpdateScene> pUpdateMessage ) = 0;
virtual void PushUpdate ( std::unique_ptr<CUpdateScene> pUpdateMessage ) = 0;
///
/// \brief Reset the worker.
......
......@@ -71,7 +71,7 @@ namespace ITA
return m_pCurrentTask.get ( ) != nullptr;
}
void CWorkerThread::PostUpdate ( std::unique_ptr<CUpdateScene> pUpdate )
void CWorkerThread::PushUpdate ( std::unique_ptr<CUpdateScene> pUpdate )
{
//PROFILER_FUNCTION ( );
PROFILER_VALUE ( "Update to Worker", pUpdate->GetID ( ) );
......
......@@ -99,7 +99,7 @@ namespace ITA
StopGently ( true );
}
void CMasterSimulationController::PostUpdate ( std::unique_ptr<IUpdateMessage> pUpdateMessage )
void CMasterSimulationController::PushUpdate ( std::unique_ptr<IUpdateMessage> pUpdateMessage )
{
//PROFILER_FUNCTION ( );
PROFILER_VALUE ( "Enqueued Update to Master Simulation Controller", pUpdateMessage->GetID ( ) );
......@@ -167,18 +167,18 @@ namespace ITA
if ( const auto rawUpdateScene = dynamic_cast< CUpdateScene* >( rawUpdate ) )
{
// We make three copies of the update message, one for each scheduler.
m_pDSScheduler->PostUpdate ( std::make_unique<CUpdateScene> ( *rawUpdateScene ) );
m_pERScheduler->PostUpdate ( std::make_unique<CUpdateScene> ( *rawUpdateScene ) );
m_pDDScheduler->PostUpdate ( std::make_unique<CUpdateScene> ( *rawUpdateScene ) );
m_pDSScheduler->PushUpdate ( std::make_unique<CUpdateScene> ( *rawUpdateScene ) );
m_pERScheduler->PushUpdate ( std::make_unique<CUpdateScene> ( *rawUpdateScene ) );
m_pDDScheduler->PushUpdate ( std::make_unique<CUpdateScene> ( *rawUpdateScene ) );
}
else
{
const auto rawUpdateConfig = dynamic_cast< CUpdateConfig* >( rawUpdate );
// We make three copies of the update message, one for each scheduler.
m_pDSScheduler->PostUpdate ( std::make_unique<CUpdateConfig> ( *rawUpdateConfig ) );
m_pERScheduler->PostUpdate ( std::make_unique<CUpdateConfig> ( *rawUpdateConfig ) );
m_pDDScheduler->PostUpdate ( std::make_unique<CUpdateConfig> ( *rawUpdateConfig ) );
m_pDSScheduler->PushUpdate ( std::make_unique<CUpdateConfig> ( *rawUpdateConfig ) );
m_pERScheduler->PushUpdate ( std::make_unique<CUpdateConfig> ( *rawUpdateConfig ) );
m_pDDScheduler->PushUpdate ( std::make_unique<CUpdateConfig> ( *rawUpdateConfig ) );
}
}
PROFILER_END_SECTION ( );
......
......@@ -95,7 +95,7 @@ namespace ITA
StopGently ( true );
}
void CScheduler::PostUpdate ( std::unique_ptr<IUpdateMessage> pUpdateMessage )
void CScheduler::PushUpdate ( std::unique_ptr<IUpdateMessage> pUpdateMessage )
{
//PROFILER_FUNCTION ( );
PROFILER_VALUE ( "Enqueued Update to " + GetThreadName ( ), pUpdateMessage->GetID ( ) );
......@@ -287,7 +287,7 @@ namespace ITA
m_mPreviousStates [update->GetReferenceID ( )] = new CUpdateScene ( *update );
// post the update to the worker.
worker->PostUpdate ( std::move ( update ) );
worker->PushUpdate ( std::move ( update ) );
}
}
PROFILER_END_SECTION ( );
......
......@@ -99,7 +99,7 @@ struct CompleteTest : public testing::Test, public ITATimerEventHandler
update->SetSourceReceiverPair ( std::move ( source ),
std::move ( receiver ) );
masterController->PostUpdate ( std::move ( update ) );
masterController->PushUpdate ( std::move ( update ) );
}
};
......@@ -114,7 +114,7 @@ TEST_F ( CompleteTest, DISABLED_correctResult )
update->SetSourceReceiverPair ( std::move ( source ),
std::move ( receiver ) );
masterController->PostUpdate ( std::move ( update ) );
masterController->PushUpdate ( std::move ( update ) );
// We need to wait a bit for the workers to start working
VistaTimeUtils::Sleep ( 500 );
......
......@@ -120,7 +120,7 @@ TEST_F ( LocalSchedulerTest, UpdateToWorker )
auto update = std::make_unique<CUpdateScene> ( 1 );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PostUpdate ( std::move ( update ) );
scheduler->PushUpdate ( std::move ( update ) );
}
// We have to wait a bit for the thread inside the controller to do its thing.
......@@ -139,7 +139,7 @@ TEST_F ( LocalSchedulerTest, UpdateToHandler )
auto update = std::make_unique<CUpdateScene> ( 1 );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PostUpdate ( std::move ( update ) );
scheduler->PushUpdate ( std::move ( update ) );
}
// We have to wait a bit for the thread inside the controller to do its thing.
......@@ -154,7 +154,7 @@ TEST_F ( LocalSchedulerTest, UpdateToHandler1 )
auto update = std::make_unique<CUpdateScene> ( 1 );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PostUpdate ( std::move ( update ) );
scheduler->PushUpdate ( std::move ( update ) );
// We have to wait a bit for the thread inside the controller to do its thing.
VistaTimeUtils::Sleep ( 250 );
......@@ -164,7 +164,7 @@ TEST_F ( LocalSchedulerTest, UpdateToHandler1 )
TEST_F ( LocalSchedulerTest, Reset )
{
scheduler->PostUpdate ( std::make_unique<CUpdateConfig> ( CUpdateConfig::ConfigChangeType::resetAll ) );
scheduler->PushUpdate ( std::make_unique<CUpdateConfig> ( CUpdateConfig::ConfigChangeType::resetAll ) );
// We have to wait a bit for the thread inside the controller to do its thing.
VistaTimeUtils::Sleep ( 1000 );
......@@ -179,7 +179,7 @@ TEST_F ( LocalSchedulerTest, Filter )
auto update = std::make_unique<CUpdateScene> ( 1 );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PostUpdate ( std::move ( update ) );
scheduler->PushUpdate ( std::move ( update ) );
}
// We have to wait a bit for the thread inside the controller to do its thing.
......@@ -191,7 +191,7 @@ TEST_F ( LocalSchedulerTest, Filter )
auto update = std::make_unique<CUpdateScene> ( 1 );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PostUpdate ( std::move ( update ) );
scheduler->PushUpdate ( std::move ( update ) );
}
// We have to wait a bit for the thread inside the controller to do its thing.
......@@ -210,13 +210,13 @@ TEST_F ( LocalSchedulerTest, correctNumberOfResults )
auto update = std::make_unique<CUpdateScene> ( j );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PostUpdate ( std::move ( update ) );
scheduler->PushUpdate ( std::move ( update ) );
}
auto update = std::make_unique<CUpdateScene> ( 42 );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
scheduler->PostUpdate ( std::move ( update ) );
scheduler->PushUpdate ( std::move ( update ) );
// We have to wait a bit for the thread inside the controller to do its thing. And the second bunch is not replaced by filterReplace.
VistaTimeUtils::Sleep ( 250 );
......
......@@ -52,7 +52,7 @@ TEST_F ( MasterSimulationControllerTest, uptadeToScheduler )
auto update = std::make_unique<CUpdateScene> ( 1 );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
controller->PostUpdate ( std::move ( update ) );
controller->PushUpdate ( std::move ( update ) );
}
// We have to wait a bit for the thread inside the controller to do its thing.
......@@ -71,7 +71,7 @@ TEST_F ( MasterSimulationControllerTest, attachResultHandler )
auto update = std::make_unique<CUpdateScene> ( 1 );
update->SetSourceReceiverPair ( std::make_unique<C3DObject> ( VistaVector3D { 1,1,1 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::source, 1 ),
std::make_unique<C3DObject> ( VistaVector3D { 3,6,2 }, VistaQuaternion { 1,0,0,0 }, C3DObject::Type::receiver, 1 ) );
controller->PostUpdate ( std::move ( update ) );
controller->PushUpdate ( std::move ( update ) );
}
// We have to wait a bit for the thread inside the controller to do its thing.
......
......@@ -53,7 +53,7 @@ struct MockScheduler : public ISchedulerInterface
}
void PostUpdate ( std::unique_ptr<ITA::SimulationScheduler::IUpdateMessage> pUpdate ) override
void PushUpdate ( std::unique_ptr<ITA::SimulationScheduler::IUpdateMessage> pUpdate ) override
{
updates.push_back ( pUpdate.release ( ) );
......@@ -129,7 +129,7 @@ struct MockWorker : public IWorkerInterface
return false;
}
void PostUpdate ( std::unique_ptr<CUpdateScene> pUpdateMessage ) override
void PushUpdate ( std::unique_ptr<CUpdateScene> pUpdateMessage ) override
{
vUpdates.push_back ( pUpdateMessage.release ( ) );
m_pParentScheduler->HandleSimulationFinished ( std::make_unique<CRIRSimulationResult> ( ) );
......
......@@ -50,7 +50,7 @@ TEST_F ( RavenWorkerThreadTest, updateToSimulatorAndResultToScheduler )
update->SetSourceReceiverPair ( std::move ( source ),
std::move ( receiver ) );
worker->PostUpdate ( std::move ( update ) );
worker->PushUpdate ( std::move ( update ) );
// wait for the thread
VistaTimeUtils::Sleep ( 100 );
......
......@@ -67,7 +67,7 @@ struct TestRavenWorkerInterface : public IRavenWorkerInterface
return false;
}
void PostUpdate ( std::unique_ptr<CUpdateScene> pUpdateMessage ) override
void PushUpdate ( std::unique_ptr<CUpdateScene> pUpdateMessage ) override
{
vUpdates.push_back ( pUpdateMessage.release ( ) );
m_pParentScheduler->HandleSimulationFinished ( std::make_unique<CRIRSimulationResult> ( ) );
......
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