| 1863 | |
| 1864 | template <> |
| 1865 | Option<Value::Scalar> Resources::get(const string& name) const |
| 1866 | { |
| 1867 | Value::Scalar total; |
| 1868 | bool found = false; |
| 1869 | |
| 1870 | foreach ( |
| 1871 | const Resource_Unsafe& resource_, |
| 1872 | resourcesNoMutationWithoutExclusiveOwnership) { |
| 1873 | if (resource_->resource.name() == name && |
| 1874 | resource_->resource.type() == Value::SCALAR) { |
| 1875 | total += resource_->resource.scalar(); |
| 1876 | found = true; |
| 1877 | } |
| 1878 | } |
| 1879 | |
| 1880 | if (found) { |
| 1881 | return total; |
| 1882 | } |
| 1883 | |
| 1884 | return None(); |
| 1885 | } |
| 1886 | |
| 1887 | |
| 1888 | template <> |
no test coverage detected