performance/Tutorial_NoTimeSlicing.cpp
#include "common/oneworldenv.h"
namespace
{
#define KT_TEST_ENV_CLASS OneWorldEnv
KT_TEST_ENV {}
KT_TUTORIAL
{
KT_LOG_TITLE_BEGIN("TUTORIAL - How to perform a single time-sliced query using the default queue of the world with no TimeSlicing");
KT_ASSERT(KT_ENV.AddNavData("generated/canyon/canyon.NavData") != nullptr);
query->BindToDatabase(navWorld->GetDatabase(0));
Kaim::QueryQueue* queryQueue = navWorld->GetAsyncQueryDispatcher()->GetQueue(query, Kaim::AsyncQueryDispatchId_PathFinder);
navWorld->PushAsyncQuery(query, Kaim::AsyncQueryDispatchId_PathFinder);
navWorld->Update();
KT_ASSERT(query->IsSafeToReadResult() == true);
}
KT_TUTORIAL
{
KT_LOG_TITLE_BEGIN("TUTORIAL - How to perform a single time-sliced query without using any Queue.");
KT_ASSERT(KT_ENV.AddNavData("generated/canyon/canyon.NavData") != nullptr);
query->BindToDatabase(navWorld->GetDatabase(0));
query->PerformQueryBlocking();
KT_ASSERT(query->IsSafeToReadResult() == true);
}
}