31 #include "RequestQueue.h"
35 #include <hu/varadiistvan/xplcommon/Util.h>
41 using hu::varadiistvan::xplcommon::Util;
45 float RequestQueue::flightLoop(
float ,
51 #if USE_SCHEDULE_FLIGHTLOOP
63 #if USE_SCHEDULE_FLIGHTLOOP
64 XPLMCreateFlightLoop_t createFL;
66 createFL.structSize =
sizeof(createFL);
67 createFL.phase = xplm_FlightLoop_Phase_AfterFlightModel;
69 createFL.refcon =
this;
71 flightLoopID = XPLMCreateFlightLoop(&createFL);
90 #if USE_SCHEDULE_FLIGHTLOOP
92 XPLMScheduleFlightLoop(flightLoopID, -2.0,
true);
115 #if USE_SCHEDULE_FLIGHTLOOP
116 XPLMDestroyFlightLoop(flightLoopID);
118 XPLMUnregisterFlightLoopCallback(&
flightLoop,
this);
132 if (queuedRequests.empty())
return;
134 for(requests_t::const_iterator i = queuedRequests.begin();
135 i!=queuedRequests.end(); ++i)
141 for(requests_t::const_iterator i = queuedRequests.begin();
142 i!=queuedRequests.end(); ++i)
144 (*i)->completed =
true;
static constexpr float flightLoopInterval
hu::varadiistvan::scpl::CondVar requestsDone
bool execute(Request *request)
std::vector< Request * > requests_t
static float flightLoop(float inElapsedSinceLastCall, float inElapsedTimeSinceLastFlightLoop, int inCounter, void *inRefCon)
hu::varadiistvan::scpl::Mutex mutex