MCPcopy Create free account
hub / github.com/apache/mesos / get

Method get

src/v1/resources.cpp:1865–1885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1863
1864template <>
1865Option<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
1888template <>

Callers 15

versionMethod · 0.45
versionFunction · 0.45
mesos.cppFile · 0.45
parseMethod · 0.45
foreachFunction · 0.45
fromJSONMethod · 0.45
fromStringMethod · 0.45
isReservedMethod · 0.45
validateMethod · 0.45
isEmptyMethod · 0.45
containsMethod · 0.45
resources.cppFile · 0.45

Calls 3

NoneClass · 0.85
filterFunction · 0.85
nameMethod · 0.45

Tested by

no test coverage detected