* Returns the total size of the items in the container. * @param rule Pointer to ruleset. * @return Total item size. */
| 139 | * @return Total item size. |
| 140 | */ |
| 141 | double ItemContainer::getTotalSize(const Ruleset *rule) const |
| 142 | { |
| 143 | double total = 0; |
| 144 | for (std::map<std::string, int>::const_iterator i = _qty.begin(); i != _qty.end(); ++i) |
| 145 | { |
| 146 | total += rule->getItem(i->first)->getSize() * i->second; |
| 147 | } |
| 148 | return total; |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * Returns all the items currently contained within. |
no test coverage detected