mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T259, Ref T243 adjusted providers to use common base classes
This commit is contained in:
@@ -85,37 +85,37 @@ namespace BlackMisc
|
||||
|
||||
CClientList CClientAware::getClients() const
|
||||
{
|
||||
if (m_clientProvider) { return m_clientProvider->getClients(); }
|
||||
if (this->provider()) { return this->provider()->getClients(); }
|
||||
return CClientList();
|
||||
}
|
||||
|
||||
CClient CClientAware::getClientOrDefaultForCallsign(const Aviation::CCallsign &callsign) const
|
||||
{
|
||||
if (m_clientProvider) { return m_clientProvider->getClientOrDefaultForCallsign(callsign); }
|
||||
if (this->provider()) { return this->provider()->getClientOrDefaultForCallsign(callsign); }
|
||||
return CClient();
|
||||
}
|
||||
|
||||
bool CClientAware::hasClientInfo(const CCallsign &callsign) const
|
||||
{
|
||||
if (m_clientProvider) { return m_clientProvider->hasClientInfo(callsign); }
|
||||
if (this->provider()) { return this->provider()->hasClientInfo(callsign); }
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CClientAware::addNewClient(const CClient &client)
|
||||
{
|
||||
if (m_clientProvider) { return m_clientProvider->addNewClient(client); }
|
||||
if (this->provider()) { return this->provider()->addNewClient(client); }
|
||||
return false;
|
||||
}
|
||||
|
||||
int CClientAware::updateOrAddClient(const CCallsign &callsign, const CPropertyIndexVariantMap &vm, bool skipEqualValues)
|
||||
{
|
||||
if (m_clientProvider) { return m_clientProvider->updateOrAddClient(callsign, vm, skipEqualValues); }
|
||||
if (this->provider()) { return this->provider()->updateOrAddClient(callsign, vm, skipEqualValues); }
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CClientAware::removeClient(const CCallsign &callsign)
|
||||
{
|
||||
if (m_clientProvider) { return m_clientProvider->removeClient(callsign); }
|
||||
if (this->provider()) { return this->provider()->removeClient(callsign); }
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,8 +105,7 @@ namespace BlackMisc
|
||||
CClientAware() {}
|
||||
|
||||
//! Constructor
|
||||
CClientAware(IClientProvider *clientProvider) : m_clientProvider(clientProvider) { }
|
||||
IClientProvider *m_clientProvider = nullptr; //!< access to object
|
||||
CClientAware(IClientProvider *clientProvider) : IProviderAware(clientProvider) { }
|
||||
};
|
||||
|
||||
//! Client provider dummy for testing
|
||||
|
||||
Reference in New Issue
Block a user