mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
refs #395, turned remote aircraft provider interface into thread safe interfaces
* references gone, situations, parts, aircraft now as threadsafe copy * read only interface gone (no longer references, so no longer needed)
This commit is contained in:
committed by
Mathew Sutcliffe
parent
24094eaf61
commit
6debd33b4f
@@ -19,14 +19,19 @@ namespace BlackMisc
|
||||
CRemoteAircraftProviderDummy::CRemoteAircraftProviderDummy(QObject *parent) : QObject(parent)
|
||||
{ }
|
||||
|
||||
const CSimulatedAircraftList &CRemoteAircraftProviderDummy::remoteAircraft() const
|
||||
CSimulatedAircraftList CRemoteAircraftProviderDummy::getAircraftInRange() const
|
||||
{
|
||||
return m_aircraft;
|
||||
}
|
||||
|
||||
CSimulatedAircraftList &CRemoteAircraftProviderDummy::remoteAircraft()
|
||||
int CRemoteAircraftProviderDummy::getAircraftInRangeCount() const
|
||||
{
|
||||
return m_aircraft;
|
||||
return m_aircraft.size();
|
||||
}
|
||||
|
||||
CSimulatedAircraft CRemoteAircraftProviderDummy::getAircraftForCallsign(const CCallsign &callsign) const
|
||||
{
|
||||
return m_aircraft.findFirstByCallsign(callsign);
|
||||
}
|
||||
|
||||
CAircraftPartsList CRemoteAircraftProviderDummy::remoteAircraftParts(const BlackMisc::Aviation::CCallsign &callsign, qint64 cutoffTimeBefore) const
|
||||
@@ -87,6 +92,20 @@ namespace BlackMisc
|
||||
return n > 0;
|
||||
}
|
||||
|
||||
bool CRemoteAircraftProviderDummy::updateAircraftRendered(const CCallsign &callsign, bool rendered, const QString &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexRendered, CVariant::fromValue(rendered));
|
||||
int n = this->m_aircraft.applyIfCallsign(callsign, vm);
|
||||
return n > 0;
|
||||
}
|
||||
|
||||
void CRemoteAircraftProviderDummy::updateMarkAllAsNotRendered(const QString &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
this->m_aircraft.markAllAsNotRendered();
|
||||
}
|
||||
|
||||
void CRemoteAircraftProviderDummy::insertNewSituation(const CAircraftSituation &situation)
|
||||
{
|
||||
this->m_situations.push_front(situation);
|
||||
|
||||
Reference in New Issue
Block a user