Home | History | Annotate | Download | only in utils

Lines Matching refs:ClientDescriptor

37  * The ClientDescriptor class is a container for a given key/value pair identifying a shared
41 * Aside from the priority, these values are immutable once the ClientDescriptor has been
45 class ClientDescriptor final {
47 ClientDescriptor(const KEY& key, const VALUE& value, int32_t cost,
49 ClientDescriptor(KEY&& key, VALUE&& value, int32_t cost, std::set<KEY>&& conflictingKeys,
52 ~ClientDescriptor();
96 friend bool operator < (const ClientDescriptor<K, V>& a, const ClientDescriptor<K, V>& b);
105 }; // class ClientDescriptor
108 bool operator < (const ClientDescriptor<K, V>& a, const ClientDescriptor<K, V>& b) {
113 ClientDescriptor<KEY, VALUE>::ClientDescriptor(const KEY& key, const VALUE& value, int32_t cost,
119 ClientDescriptor<KEY, VALUE>::ClientDescriptor(KEY&& key, VALUE&& value, int32_t cost,
126 ClientDescriptor<KEY, VALUE>::~ClientDescriptor() {}
129 const KEY& ClientDescriptor<KEY, VALUE>::getKey() const {
134 const VALUE& ClientDescriptor<KEY, VALUE>::getValue() const {
139 int32_t ClientDescriptor<KEY, VALUE>::getCost() const {
144 int32_t ClientDescriptor<KEY, VALUE>::getPriority() const {
149 int32_t ClientDescriptor<KEY, VALUE>::getOwnerId() const {
154 bool ClientDescriptor<KEY, VALUE>::isConflicting(const KEY& key) const {
163 std::set<KEY> ClientDescriptor<KEY, VALUE>::getConflicting() const {
168 void ClientDescriptor<KEY, VALUE>::setPriority(int32_t priority) {
180 void onClientAdded(const ClientDescriptor<KEY, VALUE>& descriptor);
181 void onClientRemoved(const ClientDescriptor<KEY, VALUE>& descriptor);
186 const ClientDescriptor<KEY, VALUE>& /*descriptor*/) {}
190 const ClientDescriptor<KEY, VALUE>& /*descriptor*/) {}
222 * Add a given ClientDescriptor to the managed list. ClientDescriptors for clients that
225 * This may return the ClientDescriptor passed in if it would be evicted.
227 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> addAndEvict(
228 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client);
232 * ClientDescriptor with an owner in this mapping.
242 * Remove and return the ClientDescriptor with a given key.
244 std::shared_ptr<ClientDescriptor<KEY, VALUE>> remove(const KEY& key);
247 * Remove the given ClientDescriptor.
249 void remove(const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& value);
253 * ClientDescriptor.
255 * This may return the ClientDescriptor passed in if it would be evicted.
257 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> wouldEvict(
258 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client) const;
263 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> getIncompatibleClients(
264 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client) const;
269 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> getAll() const;
283 * Return the ClientDescriptor corresponding to the given key, or an empty shared pointer
286 std::shared_ptr<ClientDescriptor<KEY, VALUE>> get(const KEY& key) const;
295 status_t waitUntilRemoved(const std::shared_ptr<ClientDescriptor<KEY, VALUE>> client,
303 * void onClientRemoved(const ClientDescriptor<KEY, VALUE>& descriptor);
304 * void onClientAdded(const ClientDescriptor<KEY, VALUE>& descriptor);
323 * ClientDescriptor. If returnIncompatibleClients is set to true, instead, return the
328 * This may return the ClientDescriptor passed in.
330 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> wouldEvictLocked(
331 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client,
340 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> mClients;
355 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>>
357 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client) const {
363 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>>
365 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client) const {
371 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>>
373 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client,
376 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>> evictList;
464 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>>
466 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& client) {
482 [&iter] (std::shared_ptr<ClientDescriptor<KEY, VALUE>>& curClientPtr) {
499 std::vector<std::shared_ptr<ClientDescriptor<KEY, VALUE>>>
538 std::shared_ptr<ClientDescriptor<KEY, VALUE>> ClientManager<KEY, VALUE, LISTENER>::get(
544 return std::shared_ptr<ClientDescriptor<KEY, VALUE>>(nullptr);
560 std::shared_ptr<ClientDescriptor<KEY, VALUE>> ClientManager<KEY, VALUE, LISTENER>::remove(
564 std::shared_ptr<ClientDescriptor<KEY, VALUE>> ret;
568 [this, &key, &ret] (std::shared_ptr<ClientDescriptor<KEY, VALUE>>& curClientPtr) {
583 const std::shared_ptr<ClientDescriptor<KEY, VALUE>> client,
621 const std::shared_ptr<ClientDescriptor<KEY, VALUE>>& value) {
625 [this, &value] (std::shared_ptr<ClientDescriptor<KEY, VALUE>>& curClientPtr) {