9using namespace swift::misc::aviation;
11namespace swift::misc::network
18 clients = m_clients.values();
27 m_clients = perCallsign;
53 if (m_clients.contains(callsign))
55 return m_clients.value(callsign);
64 SWIFT_VERIFY_X(hasCallsign, Q_FUNC_INFO,
"Need callsign in client");
81 return m_clients.contains(callsign);
97 m_clients[callsign] = client;
102 bool skipEqualValues)
113 CClient &client = m_clients[callsign];
114 c = client.
apply(vm, skipEqualValues).
size();
121 m_clients[callsign] = client;
129 return m_clients.remove(callsign);
182 m_clients[callsign] = client;
193 if (!m_clients.contains(callsign))
197 m_clients[callsign].setSwiftClient(
true);
201 void CClientAware::anchor() {}
207 return this->
provider()->getClients();
216 return this->
provider()->getClientOrDefaultForCallsign(callsign);
225 return this->
provider()->hasClientInfo(callsign);
234 return this->
provider()->addNewClient(client);
240 bool skipEqualValues)
244 return this->
provider()->updateOrAddClient(callsign, vm, skipEqualValues);
253 return this->
provider()->removeClient(callsign);
262 return this->
provider()->autoAdjustCientGndCapability(situation);
271 return this->
provider()->addClientGndCapability(callsign);
282 this->
provider()->markAsSwiftClient(callsign);
bool isEmpty() const
Synonym for empty.
Specialized value object compliant map for variants, based on indexes.
size_type size() const
Returns number of elements in the sequence.
IClientProvider * provider()
Value object encapsulating information of an aircraft's situation.
aviation::COnGroundInfo getOnGroundInfo() const
On ground info.
bool isOnGround() const
Is on ground?
const CCallsign & getCallsign() const
Corresponding callsign.
Value object encapsulating information of a callsign.
bool isEmpty() const
Is empty?
Value object for a set of callsigns.
@ InFromNetwork
received from network
OnGroundDetails getGroundDetails() const
Get ground details.
QHash< CCallsign, OBJ > asCallsignHash() const
Turn into callsign hash.
CONTAINER findByCallsigns(const CCallsignSet &callsigns) const
Find 0..n aircraft matching any of a set of callsigns.
CPropertyIndexList apply(const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false)
Update by variant map.
bool addClientGndCapability(const aviation::CCallsign &callsign)
Add gnd.flag capability.
int updateOrAddClient(const aviation::CCallsign &callsign, const CPropertyIndexVariantMap &vm, bool skipEqualValues)
Update or add a client.
bool hasClientInfo(const aviation::CCallsign &callsign) const
Client info for given callsign?
CClientList getClients() const
clientprovider
swift::misc::network::CClient getClientOrDefaultForCallsign(const aviation::CCallsign &callsign) const
Other client for the given callsigns.
bool autoAdjustCientGndCapability(const aviation::CAircraftSituation &situation)
Adjust gnd.flag capability from situation.
bool addNewClient(const CClient &client)
Add a new client, if existing nothing will be added.
void markAsSwiftClient(const aviation::CCallsign &callsign)
Mark as other swift client.
int removeClient(const aviation::CCallsign &callsign)
Remove client.
void addCapability(Capability capability)
Add capability.
bool hasGndFlagCapability() const
Supports gnd.flag?
bool isValid() const
Is valid.
void removeCapability(Capability capability)
Remove capability.
@ FsdWithGroundFlag
supports gnd.
const aviation::CCallsign & getCallsign() const
Callsign used with other client.
Value object encapsulating a list of voice rooms.
Client provider dummy for testing.
static CClientProviderDummy * instance()
Dummy instance.
int removeClient(const aviation::CCallsign &callsign)
Remove client.
int updateOrAddClient(const aviation::CCallsign &callsign, const CPropertyIndexVariantMap &vm, bool skipEqualValues=true)
Update or add a client.
bool hasClientInfo(const aviation::CCallsign &callsign) const
Client info for given callsign?
bool addClientGndCapability(const aviation::CCallsign &callsign)
Add gnd.flag capability.
CClientList getClientsForCallsigns(const aviation::CCallsignSet &callsigns) const
Returns a list of other clients corresponding to the given callsigns.
void markAsSwiftClient(const aviation::CCallsign &callsign)
Mark as other swift client.
bool setOtherClient(const swift::misc::network::CClient &client)
Set client for its callsign.
bool addNewClient(const CClient &client)
Add a new client, if existing nothing will be added.
void setClients(const CClientList &clients)
Set other clients.
CClientList getClients() const
clientprovider
void clearClients()
Set other clients.
CClient getClientOrDefaultForCallsign(const aviation::CCallsign &callsign) const
Other client for the given callsigns.
bool setClientGndCapability(const aviation::CCallsign &callsign, bool supportGndFlag)
Set gnd.flag capability.
bool autoAdjustCientGndCapability(const aviation::CAircraftSituation &situation)
Adjust gnd.flag capability from situation.
QHash< aviation::CCallsign, CClient > CClientPerCallsign
Client per callsign.
#define SWIFT_VERIFY_X(COND, WHERE, WHAT)
A weaker kind of assert.