50 std::vector<std::unique_ptr<Instance>>
children,
51 std::vector<services::Service *>
services,
52 std::vector<std::unique_ptr<BundlePort>> &
ports);
61 std::vector<const Instance *> ret;
63 ret.push_back(c.get());
70 std::vector<std::reference_wrapper<BundlePort>> ret;
71 for (
const auto &p :
ports)
76 const std::map<AppID, const BundlePort &> &
getPorts()
const {
90 const std::optional<ModuleInfo>
info;
91 const std::vector<std::unique_ptr<Instance>>
children;
93 const std::vector<services::Service *>
services;
94 const std::vector<std::unique_ptr<BundlePort>>
ports;
95 const std::map<AppID, const BundlePort &>
portIndex;
106 std::vector<std::unique_ptr<Instance>>
children,
107 std::vector<services::Service *>
services,
108 std::vector<std::unique_ptr<BundlePort>> &
ports)
Represents either the top level or an instance of a hardware module.
virtual ~HWModule()=default
const std::map< AppID, Instance * > & getChildren() const
Access the module's children by ID.
const std::optional< ModuleInfo > info
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)
const std::vector< services::Service * > & getServices() const
Access the services provided by this module.
const std::vector< services::Service * > services
const std::map< AppID, const BundlePort & > portIndex
const std::map< AppID, Instance * > childIndex
std::optional< ModuleInfo > getInfo() const
Access the module's metadata, if any.
const std::map< AppID, const BundlePort & > & getPorts() const
Access the module's ports by ID.
std::vector< const Instance * > getChildrenOrdered() const
Get a vector of the module's children in a deterministic order.
std::vector< std::reference_wrapper< BundlePort > > getPortsOrdered() const
Get the module's ports in a deterministic order.
Subclass of HWModule which represents a submodule instance.
Instance(const Instance &)=delete
Instance(AppID id, std::optional< ModuleInfo > info, std::vector< std::unique_ptr< Instance >> children, std::vector< services::Service * > services, std::vector< std::unique_ptr< BundlePort >> &ports)
const AppID getID() const
Get the instance's ID, which it will always have.
Parent class of all APIs modeled as 'services'.