class BindNodeSet

Defined at line 18 of file ../../src/devices/bin/driver_manager/bind/bind_node_set.h

This class keeps track of all the nodes available for binding. Its purpose is to prevent the set

of nodes from being modified during an ongoing bind process, which is the cause of most async

bind errors. During an ongoing bind process, it'll keep track of any new changes to the orphaned

and multibind nodes, 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 node sets for the next bind process.

Defined at line 9 of file ../../src/devices/bin/driver_manager/bind/bind_node_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 19 of file ../../src/devices/bin/driver_manager/bind/bind_node_set.cc

std::unordered_map<std::string, std::weak_ptr<Node>> CurrentOrphanedNodes ()

Functions to return a copy of |orphaned_nodes_| and |multibind_nodes_|. We return a copy, not

const reference to prevent iterator invalidating errors.

Defined at line 39 of file ../../src/devices/bin/driver_manager/bind/bind_node_set.h

std::unordered_map<std::string, std::weak_ptr<Node>> CurrentMultibindNodes ()

Defined at line 42 of file ../../src/devices/bin/driver_manager/bind/bind_node_set.h

void AddOrphanedNode (Node & node)

Defined at line 42 of file ../../src/devices/bin/driver_manager/bind/bind_node_set.cc

void set_on_bind_state_changed (fit::function<void ()> callback)

Defined at line 46 of file ../../src/devices/bin/driver_manager/bind/bind_node_set.h

size_t NumOfOrphanedNodes ()

Defined at line 50 of file ../../src/devices/bin/driver_manager/bind/bind_node_set.h

size_t NumOfAvailableNodes ()

Defined at line 51 of file ../../src/devices/bin/driver_manager/bind/bind_node_set.h

void RemoveOrphanedNode (std::string node_moniker)

If available, remove the node with the matching |node_moniker| from |orphaned_nodes_|.

Defined at line 52 of file ../../src/devices/bin/driver_manager/bind/bind_node_set.cc

bool is_bind_ongoing ()

Defined at line 53 of file ../../src/devices/bin/driver_manager/bind/bind_node_set.h

void AddOrMoveMultibindNode (Node & node)

Add |node| to |multibind_nodes_|. Remove it from |orphaned_nodes_| if it exists.

Defined at line 60 of file ../../src/devices/bin/driver_manager/bind/bind_node_set.cc

bool MultibindContains (std::string node_moniker)

Defined at line 69 of file ../../src/devices/bin/driver_manager/bind/bind_node_set.cc