selectSubnet() should return a ConstSubnetXPtr
Two proposals to improve subnets:
- use for getSubnet the same code as for getBySubnetId (so O(log(N)) vs current O(N))
- selectSubnet should return a ConstSubnetXPtr i.e.
boost::shared_ptr<const SubnetX>
The first proposal is trivial tp implement so should be done ASAP if there is no good reason to keep the current full scan.
The second proposal is more complex: if a SubnetXPtr can be cast to a ConstSubnetXPtr it is not true for boost::any_cast (so for hook parameters) and of course it requires to not use a not const method (but as there is no reason to modify the subnet returned by selectSubnet one can consider that all not modifying methods should be const methods...).