Returns the total guaranteed resource quantities requested by all quotas in the tree. Since a role's guarantees must be greater than or equal to the sum of the guarantees of its children, we can just sum the guarantees of the top-level roles.
| 144 | // than or equal to the sum of the guarantees of its children, we can |
| 145 | // just sum the guarantees of the top-level roles. |
| 146 | ResourceQuantities totalGuarantees() const |
| 147 | { |
| 148 | ResourceQuantities result; |
| 149 | |
| 150 | // Don't include the root node because it does not have quota set. |
| 151 | foreachvalue (const unique_ptr<Node>& child, root->children) { |
| 152 | result += child->quota.guarantees; |
| 153 | } |
| 154 | |
| 155 | return result; |
| 156 | } |
| 157 | |
| 158 | private: |
| 159 | struct Node |
no outgoing calls
no test coverage detected