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

Method get

src/common/resources.cpp:1884–1904  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1882
1883template <>
1884Option<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
1907template <>

Callers 15

readFunction · 0.45
readCredentialFunction · 0.45
createMethod · 0.45
CheckerMethod · 0.45
~CheckerMethod · 0.45
pauseMethod · 0.45
resumeMethod · 0.45
processCheckResultMethod · 0.45
foreachFunction · 0.45
CheckerProcessMethod · 0.45
processCheckResultMethod · 0.45
commandCheckMethod · 0.45

Calls 3

NoneClass · 0.85
filterFunction · 0.85
nameMethod · 0.45

Tested by

no test coverage detected