blob: 91bce7a082f0ec124740b8bf631f69882c11f67d [file] [log] [blame]
action auto-bind(comp) {
// Selects the interfaces to connect
clients = $comp/interface::*[required(.)][not(bound(.))];
for itf : $clients {
// Search for candidates compatible interfaces
candidates = $comp/sibling::*/interface::*[compatible($itf, .)];
if (not(empty($candidates))) {
// Connect one of these candidates
bind($itf, one-of($candidates));
}
}
return size($comp/interface::*[required(.)][not(bound(.))]) == 0;
}