| 1882 | |
| 1883 | template <> |
| 1884 | Option<Value::Scalar> Resources::get(const string& name) const |
| 1885 | { |
| 1886 | Value::Scalar total; |
| 1887 | bool found = false; |
| 1888 | |
| 1889 | foreach ( |
| 1890 | const Resource_Unsafe& resource_, |
| 1891 | resourcesNoMutationWithoutExclusiveOwnership) { |
| 1892 | if (resource_->resource.name() == name && |
| 1893 | resource_->resource.type() == Value::SCALAR) { |
| 1894 | total += resource_->resource.scalar(); |
| 1895 | found = true; |
| 1896 | } |
| 1897 | } |
| 1898 | |
| 1899 | if (found) { |
| 1900 | return total; |
| 1901 | } |
| 1902 | |
| 1903 | return None(); |
| 1904 | } |
| 1905 | |
| 1906 | |
| 1907 | template <> |
no test coverage detected