25 static std::map<AppID, Instance *>
26 buildIndex(
const std::vector<std::unique_ptr<Instance>> &insts) {
27 std::map<AppID, Instance *> index;
28 for (
auto &item : insts)
29 index[item->getID()] = item.get();
34 static std::map<AppID, const BundlePort &>
35 buildIndex(
const std::vector<std::unique_ptr<BundlePort>> &ports) {
36 std::map<AppID, const BundlePort &> index;
37 for (
auto &item : ports)
38 index.emplace(item->getID(), *item);
43 std::vector<std::unique_ptr<Instance>> children,
44 std::vector<services::Service *> services,
45 std::vector<std::unique_ptr<BundlePort>> &ports)
46 : info(info), children(std::move(children)),
47 childIndex(
buildIndex(this->children)), services(services),
48 ports(std::move(ports)), portIndex(
buildIndex(this->ports)) {}
52 for (
auto &port :
ports)
53 result |= port->poll();
55 result |= child->poll();
bool poll()
Master poll method.
const std::vector< std::unique_ptr< BundlePort > > ports
const std::vector< std::unique_ptr< Instance > > children
HWModule(std::optional< ModuleInfo > info, std::vector< std::unique_ptr< Instance >> children, std::vector< services::Service * > services, std::vector< std::unique_ptr< BundlePort >> &ports)
static std::map< AppID, Instance * > buildIndex(const std::vector< std::unique_ptr< Instance >> &insts)
Build an index of children by AppID.