Commit 6edc108
committed
Remove raw access to PluginInstances vector
This commit modifies the PluginInstances class to remove direct access
to the m_instances vector. Instead, we expose a new
`ForEachEnabledPlugin` method that takes a callback to operate on each
plugin. All external iteration over the instances is updated to use the
new method.
The motivation for the change is to allow modifying the way we store
instances without having to change all the clients. This is a
preliminary change to allow enabling/disabling of plugins in which case
we want to iterate over only enabled plugins.
We also considered using a custom iterator that wraps the vector
iterator and can skip over disabled instances. That works, but the
iterator code is a bit messy with all template and typedefs to make a
compliant iterator. Instead we go with the `ForEach` approach which is
easy to debug and understand.1 parent eeb4132 commit 6edc108
1 file changed
+164
-130
lines changed
0 commit comments