class BindResourceSet
Defined at line 20 of file ../../src/devices/bin/driver_manager/bind/bind_resource_set.h
This class keeps track of all the resources available for binding. Its purpose is to prevent the
set of resources from being modified during an ongoing bind process, which is the cause of most
async bind errors. During an ongoing bind process, it'll track any new changes to the
orphaned and multibind resources, and then apply the changes once the process is complete.
Public Methods
void StartNextBindProcess ()
Starts the next bind process. If there's already an ongoing bind, complete it and prepare
the resource sets for the next bind process.
Defined at line 11 of file ../../src/devices/bin/driver_manager/bind/bind_resource_set.cc
void EndBindProcess ()
Complete the bind process and set |is_bind_ongoing_| to false. Must only be called when
|is_bind_ongoing_| is true.
Defined at line 21 of file ../../src/devices/bin/driver_manager/bind/bind_resource_set.cc
std::unordered_map<ResourceId, std::weak_ptr<Resource>> CurrentOrphanedResources ()
Functions to return a copy of |orphaned_resources_| and |multibind_resources_|. We return a
copy, not const reference to prevent iterator invalidating errors.
Defined at line 41 of file ../../src/devices/bin/driver_manager/bind/bind_resource_set.h
std::unordered_map<ResourceId, std::weak_ptr<Resource>> CurrentMultibindResources ()
Defined at line 44 of file ../../src/devices/bin/driver_manager/bind/bind_resource_set.h
void AddOrphanedResource (const std::shared_ptr<Resource> & resource)
Defined at line 44 of file ../../src/devices/bin/driver_manager/bind/bind_resource_set.cc
void set_on_bind_state_changed (fit::function<void ()> callback)
Defined at line 48 of file ../../src/devices/bin/driver_manager/bind/bind_resource_set.h
size_t NumOfOrphanedResources ()
Defined at line 52 of file ../../src/devices/bin/driver_manager/bind/bind_resource_set.h
size_t NumOfAvailableResources ()
Defined at line 53 of file ../../src/devices/bin/driver_manager/bind/bind_resource_set.h
void RemoveOrphanedResource (ResourceId resource_id)
If available, remove the resource with the matching |resource_id| from the orphaned resources.
Defined at line 54 of file ../../src/devices/bin/driver_manager/bind/bind_resource_set.cc
bool is_bind_ongoing ()
Defined at line 57 of file ../../src/devices/bin/driver_manager/bind/bind_resource_set.h
void AddOrMoveMultibindResource (const std::shared_ptr<Resource> & resource)
Add |resource| to the multibind resources. Remove it from the orphaned resources if it exists.
Defined at line 62 of file ../../src/devices/bin/driver_manager/bind/bind_resource_set.cc
bool MultibindContains (ResourceId resource_id)
Defined at line 72 of file ../../src/devices/bin/driver_manager/bind/bind_resource_set.cc