Lines Matching refs:KEY

108 template<class KEY, class VALUE>
111 ClientDescriptor(const KEY& key, const VALUE& value, int32_t cost,
112 const std::set<KEY>& conflictingKeys, int32_t score, int32_t ownerId, int32_t state,
114 ClientDescriptor(KEY&& key, VALUE&& value, int32_t cost, std::set<KEY>&& conflictingKeys,
122 const KEY& getKey() const;
147 bool isConflicting(const KEY& key) const;
152 std::set<KEY> getConflicting() const;
164 KEY mKey;
167 std::set<KEY> mConflicting;
177 template<class KEY, class VALUE>
178 ClientDescriptor<KEY, VALUE>::ClientDescriptor(const KEY& key, const VALUE& value, int32_t cost, in ClientDescriptor()
179 const std::set<KEY>& conflictingKeys, int32_t score, int32_t ownerId, int32_t state, in ClientDescriptor()
185 template<class KEY, class VALUE>
186 ClientDescriptor<KEY, VALUE>::ClientDescriptor(KEY&& key, VALUE&& value, int32_t cost, in ClientDescriptor()
187 std::set<KEY>&& conflictingKeys, int32_t score, int32_t ownerId, int32_t state, in ClientDescriptor()
189 mKey{std::forward<KEY>(key)}, mValue{std::forward<VALUE>(value)}, mCost{cost}, in ClientDescriptor()
190 mConflicting{std::forward<std::set<KEY>>(conflictingKeys)},
193 template<class KEY, class VALUE>
194 ClientDescriptor<KEY, VALUE>::~ClientDescriptor() {} in ~ClientDescriptor()
196 template<class KEY, class VALUE>
197 const KEY& ClientDescriptor<KEY, VALUE>::getKey() const { in getKey()
201 template<class KEY, class VALUE>
202 const VALUE& ClientDescriptor<KEY, VALUE>::getValue() const { in getValue()
206 template<class KEY, class VALUE>
207 int32_t ClientDescriptor<KEY, VALUE>::getCost() const { in getCost()
211 template<class KEY, class VALUE>
212 const ClientPriority& ClientDescriptor<KEY, VALUE>::getPriority() const { in getPriority()
216 template<class KEY, class VALUE>
217 int32_t ClientDescriptor<KEY, VALUE>::getOwnerId() const { in getOwnerId()
221 template<class KEY, class VALUE>
222 bool ClientDescriptor<KEY, VALUE>::isConflicting(const KEY& key) const { in isConflicting()
230 template<class KEY, class VALUE>
231 std::set<KEY> ClientDescriptor<KEY, VALUE>::getConflicting() const { in getConflicting()
235 template<class KEY, class VALUE>
236 void ClientDescriptor<KEY, VALUE>::setPriority(const ClientPriority& priority) { in setPriority()
251 template<class KEY, class VALUE>
254 void onClientAdded(const ClientDescriptor<KEY, VALUE>& descriptor);
255 void onClientRemoved(const ClientDescriptor<KEY, VALUE>& descriptor);
258 template<class KEY, class VALUE>
259 void DefaultEventListener<KEY, VALUE>::onClientAdded( in onClientAdded()
260 const ClientDescriptor<KEY, VALUE>& /*descriptor*/) {} in onClientAdded() argument
262 template<class KEY, class VALUE>
263 void DefaultEventListener<KEY, VALUE>::onClientRemoved( in onClientRemoved()
264 const ClientDescriptor<KEY, VALUE>& /*descriptor*/) {} in onClientRemoved() argument
286 template<class KEY, class VALUE, class LISTENER=DefaultEventListener<KEY, VALUE>>
301 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> addAndEvict(
302 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client);
318 std::shared_ptr<ClientDescriptor<KEY, VALUE>> remove(const KEY& key);
323 void remove(const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& value);
331 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> wouldEvict(
332 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client) const;
337 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> getIncompatibleClients(
338 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client) const;
343 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> getAll() const;
348 std::vector<KEY> getAllKeys() const;
360 std::shared_ptr<ClientDescriptor<KEY, VALUE>> get(const KEY& key) const;
369 status_t waitUntilRemoved(const std::shared_ptr<ClientDescriptor<KEY, VALUE>> client,
404 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> wouldEvictLocked(
405 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client,
414 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> mClients;
418 template<class KEY, class VALUE, class LISTENER>
419 ClientManager<KEY, VALUE, LISTENER>::ClientManager() : in ClientManager()
422 template<class KEY, class VALUE, class LISTENER>
423 ClientManager<KEY, VALUE, LISTENER>::ClientManager(int32_t totalCost) : mMaxCost(totalCost) {} in ClientManager()
425 template<class KEY, class VALUE, class LISTENER>
426 ClientManager<KEY, VALUE, LISTENER>::~ClientManager() {} in ~ClientManager()
428 template<class KEY, class VALUE, class LISTENER>
429 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>>
430 ClientManager<KEY, VALUE, LISTENER>::wouldEvict( in wouldEvict()
431 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client) const { in wouldEvict() argument
436 template<class KEY, class VALUE, class LISTENER>
437 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>>
438 ClientManager<KEY, VALUE, LISTENER>::getIncompatibleClients( in getIncompatibleClients()
439 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client) const { in getIncompatibleClients() argument
444 template<class KEY, class VALUE, class LISTENER>
445 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>>
446 ClientManager<KEY, VALUE, LISTENER>::wouldEvictLocked( in wouldEvictLocked()
447 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client, in wouldEvictLocked() argument
450 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> evictList; in wouldEvictLocked()
458 const KEY& key = client->getKey(); in wouldEvictLocked()
483 const KEY& curKey = i->getKey(); in wouldEvictLocked()
537 template<class KEY, class VALUE, class LISTENER>
538 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>>
539 ClientManager<KEY, VALUE, LISTENER>::addAndEvict( in addAndEvict()
540 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client) { in addAndEvict() argument
556 [&iter] (std::shared_ptr<ClientDescriptor<KEY, VALUE>>& curClientPtr) { in addAndEvict()
572 template<class KEY, class VALUE, class LISTENER>
573 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>>
574 ClientManager<KEY, VALUE, LISTENER>::getAll() const { in getAll()
579 template<class KEY, class VALUE, class LISTENER>
580 std::vector<KEY> ClientManager<KEY, VALUE, LISTENER>::getAllKeys() const { in getAllKeys()
582 std::vector<KEY> keys(mClients.size()); in getAllKeys()
589 template<class KEY, class VALUE, class LISTENER>
590 std::vector<int32_t> ClientManager<KEY, VALUE, LISTENER>::getAllOwners() const { in getAllOwners()
599 template<class KEY, class VALUE, class LISTENER>
600 void ClientManager<KEY, VALUE, LISTENER>::updatePriorities( in updatePriorities()
611 template<class KEY, class VALUE, class LISTENER>
612 std::shared_ptr<ClientDescriptor<KEY, VALUE>> ClientManager<KEY, VALUE, LISTENER>::get( in get()
613 const KEY& key) const { in get()
618 return std::shared_ptr<ClientDescriptor<KEY, VALUE>>(nullptr); in get()
621 template<class KEY, class VALUE, class LISTENER>
622 void ClientManager<KEY, VALUE, LISTENER>::removeAll() { in removeAll()
633 template<class KEY, class VALUE, class LISTENER>
634 std::shared_ptr<ClientDescriptor<KEY, VALUE>> ClientManager<KEY, VALUE, LISTENER>::remove( in remove()
635 const KEY& key) { in remove()
638 std::shared_ptr<ClientDescriptor<KEY, VALUE>> ret; in remove()
642 [this, &key, &ret] (std::shared_ptr<ClientDescriptor<KEY, VALUE>>& curClientPtr) { in remove()
655 template<class KEY, class VALUE, class LISTENER>
656 status_t ClientManager<KEY, VALUE, LISTENER>::waitUntilRemoved( in waitUntilRemoved()
657 const std::shared_ptr<ClientDescriptor<KEY, VALUE>> client, in waitUntilRemoved() argument
687 template<class KEY, class VALUE, class LISTENER>
688 void ClientManager<KEY, VALUE, LISTENER>::setListener(const std::shared_ptr<LISTENER>& listener) { in setListener()
693 template<class KEY, class VALUE, class LISTENER>
694 void ClientManager<KEY, VALUE, LISTENER>::remove( in remove()
695 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& value) { in remove() argument
699 [this, &value] (std::shared_ptr<ClientDescriptor<KEY, VALUE>>& curClientPtr) { in remove()
709 template<class KEY, class VALUE, class LISTENER>
710 int64_t ClientManager<KEY, VALUE, LISTENER>::getCurrentCostLocked() const { in getCurrentCostLocked()