mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [04/36] mesos-site git commit: Updated the website built from mesos SHA: 2619824.
Date Mon, 06 Nov 2017 23:26:57 GMT
http://git-wip-us.apache.org/repos/asf/mesos-site/blob/20d66e1b/content/api/latest/c++/v1_2resources_8hpp_source.html
----------------------------------------------------------------------
diff --git a/content/api/latest/c++/v1_2resources_8hpp_source.html b/content/api/latest/c++/v1_2resources_8hpp_source.html
index 9571a70..6505688 100644
--- a/content/api/latest/c++/v1_2resources_8hpp_source.html
+++ b/content/api/latest/c++/v1_2resources_8hpp_source.html
@@ -89,556 +89,588 @@
 <div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="hashmap_8hpp.html">stout/hashmap.hpp</a>&gt;</span></div>
 <div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="json_8hpp.html">stout/json.hpp</a>&gt;</span></div>
 <div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="lambda_8hpp.html">stout/lambda.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="option_8hpp.html">stout/option.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="try_8hpp.html">stout/try.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="nothing_8hpp.html">stout/nothing.hpp</a>&gt;</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="option_8hpp.html">stout/option.hpp</a>&gt;</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="try_8hpp.html">stout/try.hpp</a>&gt;</span></div>
 <div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
-<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="comment">// Resources come in three types: scalar, ranges, and sets. These are</span></div>
-<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment">// represented using protocol buffers. To make manipulation of</span></div>
-<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="comment">// resources easier within the Mesos core and for scheduler writers,</span></div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment">// we provide generic overloaded operators (see below) as well as a</span></div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment">// general Resources class that encapsulates a collection of protocol</span></div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment">// buffer Resource objects. The Resources class also provides a few</span></div>
-<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="comment">// static routines to allow parsing resources (e.g., from the command</span></div>
-<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment">// line), as well as determining whether or not a Resource object is</span></div>
-<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="comment">// valid. Note that many of these operations have not been optimized</span></div>
-<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="comment">// but instead just written for correct semantics.</span></div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div>
-<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="keyword">namespace </span>mesos {</div>
-<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="keyword">namespace </span>v1 {</div>
-<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div>
-<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="comment">// NOTE: Resource objects stored in the class are always valid, are in</span></div>
-<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="comment">// the &quot;post-reservation-refinement&quot; format, and kept combined if possible.</span></div>
-<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="comment">// It is the caller&#39;s responsibility to validate any Resource object or</span></div>
-<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="comment">// repeated Resource protobufs before constructing a Resources object.</span></div>
-<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="comment">// Otherwise, invalid Resource objects will be silently stripped.</span></div>
-<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="comment">// Invalid Resource objects will also be silently ignored when used in</span></div>
-<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="comment">// arithmetic operations (e.g., +=, -=, etc.).</span></div>
-<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html">   63</a></span>&#160;<span class="keyword">class </span><a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a></div>
-<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;{</div>
-<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;  <span class="comment">// An internal abstraction to facilitate managing shared resources.</span></div>
-<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;  <span class="comment">// It allows &#39;Resources&#39; to group identical shared resource objects</span></div>
-<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;  <span class="comment">// together into a single &#39;Resource_&#39; object and tracked by its internal</span></div>
-<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;  <span class="comment">// counter. Non-shared resource objects are not grouped.</span></div>
-<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;  <span class="comment">//</span></div>
-<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;  <span class="comment">// The rest of the private section is below the public section. We</span></div>
-<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  <span class="comment">// need to define Resource_ first because the public typedefs below</span></div>
-<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <span class="comment">// depend on it.</span></div>
-<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  <span class="keyword">class </span>Resource_</div>
-<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  {</div>
-<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  <span class="keyword">public</span>:</div>
-<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="comment">/*implicit*/</span> Resource_(<span class="keyword">const</span> Resource&amp; _resource)</div>
-<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;      : resource(_resource),</div>
-<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        sharedCount(<a class="code" href="structNone.html">None</a>())</div>
-<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    {</div>
-<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;      <span class="comment">// Setting the counter to 1 to denote &quot;one copy&quot; of the shared resource.</span></div>
-<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;      <span class="keywordflow">if</span> (resource.has_shared()) {</div>
-<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        sharedCount = 1;</div>
-<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;      }</div>
-<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    }</div>
-<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div>
-<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <span class="comment">// By implicitly converting to Resource we are able to keep Resource_</span></div>
-<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="comment">// logic internal and expose only the protobuf object.</span></div>
-<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> Resource&amp;() <span class="keyword">const</span> { <span class="keywordflow">return</span> resource; }</div>
-<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div>
-<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <span class="comment">// Check whether this Resource_ object corresponds to a shared resource.</span></div>
-<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a3b642920fe195dca5e142ba9f1bf0445">isShared</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> sharedCount.isSome(); }</div>
-<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div>
-<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="comment">// Validates this Resource_ object.</span></div>
-<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <a class="code" href="classOption.html">Option&lt;Error&gt;</a> <a class="code" href="classmesos_1_1v1_1_1Resources.html#aa1501df2cd47829fcebb26410f38fa6e">validate</a>() <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div>
-<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="comment">// Check whether this Resource_ object is empty.</span></div>
-<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a1122b880d0a01c919a35a41be0fa7b94">isEmpty</a>() <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div>
-<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="comment">// The `Resource_` arithmetic, comparison operators and `contains()`</span></div>
-<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="comment">// method require the wrapped `resource` protobuf to have the same</span></div>
-<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="comment">// sharedness.</span></div>
-<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="comment">//</span></div>
-<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="comment">// For shared resources, the `resource` protobuf needs to be equal,</span></div>
-<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="comment">// and only the shared counters are adjusted or compared.</span></div>
-<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="comment">// For non-shared resources, the shared counters are none and the</span></div>
-<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="comment">// semantics of the Resource_ object&#39;s operators/contains() method</span></div>
-<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="comment">// are the same as those of the Resource objects.</span></div>
-<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
-<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="comment">// Checks if this Resource_ is a superset of the given Resource_.</span></div>
-<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#acc7fd5ead44f48cc44ad2169b5d0b5c3">contains</a>(<span class="keyword">const</span> Resource_&amp; that) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div>
-<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="comment">// The arithmetic operators, viz. += and -= assume that the corresponding</span></div>
-<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <span class="comment">// Resource objects are addable or subtractable already.</span></div>
-<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    Resource_&amp; <a class="code" href="classmesos_1_1v1_1_1Resources.html#ad367ced251edfb414891e6c0d859f264">operator+=</a>(<span class="keyword">const</span> Resource_&amp; that);</div>
-<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    Resource_&amp; <a class="code" href="classmesos_1_1v1_1_1Resources.html#ad31bd7470855a7691d10f0a4f73aa217">operator-=</a>(<span class="keyword">const</span> Resource_&amp; that);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment">// Resources come in three types: scalar, ranges, and sets. These are</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="comment">// represented using protocol buffers. To make manipulation of</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment">// resources easier within the Mesos core and for scheduler writers,</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment">// we provide generic overloaded operators (see below) as well as a</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment">// general Resources class that encapsulates a collection of protocol</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="comment">// buffer Resource objects. The Resources class also provides a few</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment">// static routines to allow parsing resources (e.g., from the command</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="comment">// line), as well as determining whether or not a Resource object is</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="comment">// valid. Note that many of these operations have not been optimized</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment">// but instead just written for correct semantics.</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="keyword">namespace </span>mesos {</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="keyword">namespace </span>v1 {</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="comment">// Forward declaration.</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="keyword">class </span>ResourceConversion;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="comment">// NOTE: Resource objects stored in the class are always valid, are in</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="comment">// the &quot;post-reservation-refinement&quot; format, and kept combined if possible.</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="comment">// It is the caller&#39;s responsibility to validate any Resource object or</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="comment">// repeated Resource protobufs before constructing a Resources object.</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="comment">// Otherwise, invalid Resource objects will be silently stripped.</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="comment">// Invalid Resource objects will also be silently ignored when used in</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="comment">// arithmetic operations (e.g., +=, -=, etc.).</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html">   68</a></span>&#160;<span class="keyword">class </span><a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;{</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="keyword">private</span>:</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;  <span class="comment">// An internal abstraction to facilitate managing shared resources.</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  <span class="comment">// It allows &#39;Resources&#39; to group identical shared resource objects</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <span class="comment">// together into a single &#39;Resource_&#39; object and tracked by its internal</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  <span class="comment">// counter. Non-shared resource objects are not grouped.</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  <span class="comment">//</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  <span class="comment">// The rest of the private section is below the public section. We</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  <span class="comment">// need to define Resource_ first because the public typedefs below</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;  <span class="comment">// depend on it.</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;  <span class="keyword">class </span>Resource_</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  {</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  <span class="keyword">public</span>:</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <span class="comment">/*implicit*/</span> Resource_(<span class="keyword">const</span> Resource&amp; _resource)</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;      : resource(_resource),</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        sharedCount(<a class="code" href="structNone.html">None</a>())</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    {</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;      <span class="comment">// Setting the counter to 1 to denote &quot;one copy&quot; of the shared resource.</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;      <span class="keywordflow">if</span> (resource.has_shared()) {</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        sharedCount = 1;</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;      }</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    }</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="comment">// By implicitly converting to Resource we are able to keep Resource_</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="comment">// logic internal and expose only the protobuf object.</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> Resource&amp;() <span class="keyword">const</span> { <span class="keywordflow">return</span> resource; }</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="comment">// Check whether this Resource_ object corresponds to a shared resource.</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a3b642920fe195dca5e142ba9f1bf0445">isShared</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> sharedCount.isSome(); }</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="comment">// Validates this Resource_ object.</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <a class="code" href="classOption.html">Option&lt;Error&gt;</a> <a class="code" href="classmesos_1_1v1_1_1Resources.html#aa1501df2cd47829fcebb26410f38fa6e">validate</a>() <span class="keyword">const</span>;</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="comment">// Check whether this Resource_ object is empty.</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a1122b880d0a01c919a35a41be0fa7b94">isEmpty</a>() <span class="keyword">const</span>;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="comment">// The `Resource_` arithmetic, comparison operators and `contains()`</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="comment">// method require the wrapped `resource` protobuf to have the same</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="comment">// sharedness.</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="comment">//</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="comment">// For shared resources, the `resource` protobuf needs to be equal,</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="comment">// and only the shared counters are adjusted or compared.</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="comment">// For non-shared resources, the shared counters are none and the</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="comment">// semantics of the Resource_ object&#39;s operators/contains() method</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="comment">// are the same as those of the Resource objects.</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="comment">// Checks if this Resource_ is a superset of the given Resource_.</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#acc7fd5ead44f48cc44ad2169b5d0b5c3">contains</a>(<span class="keyword">const</span> Resource_&amp; that) <span class="keyword">const</span>;</div>
 <div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div>
-<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#aebd5411e3ec8b4573de8e85e025178f1">operator==</a>(<span class="keyword">const</span> Resource_&amp; that) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a5e80a4c0b065ceb6cd2f0d5445964213">operator!=</a>(<span class="keyword">const</span> Resource_&amp; that) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div>
-<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="comment">// Friend classes and functions for access to private members.</span></div>
-<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a>;</div>
-<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classmesos_1_1v1_1_1Resources.html#ae280811800456648b43c902fa7a42d46">operator&lt;&lt;</a>(</div>
-<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;        std::ostream&amp; stream, <span class="keyword">const</span> Resource_&amp; resource_);</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="comment">// The arithmetic operators, viz. += and -= assume that the corresponding</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="comment">// Resource objects are addable or subtractable already.</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    Resource_&amp; <a class="code" href="classmesos_1_1v1_1_1Resources.html#ad367ced251edfb414891e6c0d859f264">operator+=</a>(<span class="keyword">const</span> Resource_&amp; that);</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    Resource_&amp; <a class="code" href="classmesos_1_1v1_1_1Resources.html#ad31bd7470855a7691d10f0a4f73aa217">operator-=</a>(<span class="keyword">const</span> Resource_&amp; that);</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#aebd5411e3ec8b4573de8e85e025178f1">operator==</a>(<span class="keyword">const</span> Resource_&amp; that) <span class="keyword">const</span>;</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a5e80a4c0b065ceb6cd2f0d5445964213">operator!=</a>(<span class="keyword">const</span> Resource_&amp; that) <span class="keyword">const</span>;</div>
 <div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div>
-<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;  <span class="keyword">private</span>:</div>
-<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="comment">// The protobuf Resource that is being managed.</span></div>
-<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    Resource resource;</div>
-<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div>
-<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="comment">// The counter for grouping shared &#39;resource&#39; objects, None if the</span></div>
-<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="comment">// &#39;resource&#39; is non-shared. This is an int so as to support arithmetic</span></div>
-<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="comment">// operations involving subtraction.</span></div>
-<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <a class="code" href="classOption.html">Option&lt;int&gt;</a> sharedCount;</div>
-<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;  };</div>
-<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div>
-<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;  <span class="keyword">static</span> <a class="code" href="classTry.html">Try&lt;Resource&gt;</a> <a class="code" href="classmesos_1_1v1_1_1Resources.html#ada21773cbd96e5163fd54711282d9d91">parse</a>(</div>
-<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;      <span class="keyword">const</span> std::string&amp; <a class="code" href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">name</a>,</div>
-<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;      <span class="keyword">const</span> std::string&amp; value,</div>
-<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;      <span class="keyword">const</span> std::string&amp; role);</div>
-<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div>
-<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;  <span class="keyword">static</span> <a class="code" href="classTry.html">Try&lt;Resources&gt;</a> <a class="code" href="classmesos_1_1v1_1_1Resources.html#ada21773cbd96e5163fd54711282d9d91">parse</a>(</div>
-<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;      <span class="keyword">const</span> std::string&amp; text,</div>
-<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;      <span class="keyword">const</span> std::string&amp; defaultRole = <span class="stringliteral">&quot;*&quot;</span>);</div>
-<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div>
-<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;  <span class="keyword">static</span> <a class="code" href="classTry.html">Try&lt;std::vector&lt;Resource&gt;</a>&gt; <a class="code" href="classmesos_1_1v1_1_1Resources.html#a013a0925b3375ede1d90f76f29d2d12e">fromJSON</a>(</div>
-<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;      <span class="keyword">const</span> <a class="code" href="structJSON_1_1Array.html">JSON::Array</a>&amp; resourcesJSON,</div>
-<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;      <span class="keyword">const</span> std::string&amp; defaultRole = <span class="stringliteral">&quot;*&quot;</span>);</div>
-<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;</div>
-<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;  <span class="keyword">static</span> <a class="code" href="classTry.html">Try&lt;std::vector&lt;Resource&gt;</a>&gt; <a class="code" href="classmesos_1_1v1_1_1Resources.html#a4c8d1ca13522473ecbeaecf8f8b31f50">fromSimpleString</a>(</div>
-<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;      <span class="keyword">const</span> std::string&amp; text,</div>
-<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;      <span class="keyword">const</span> std::string&amp; defaultRole = <span class="stringliteral">&quot;*&quot;</span>);</div>
-<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;</div>
-<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;  <span class="keyword">static</span> <a class="code" href="classTry.html">Try&lt;std::vector&lt;Resource&gt;</a>&gt; <a class="code" href="classmesos_1_1v1_1_1Resources.html#ad46385859813ded1f902075c266410c2">fromString</a>(</div>
-<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;      <span class="keyword">const</span> std::string&amp; text,</div>
-<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;      <span class="keyword">const</span> std::string&amp; defaultRole = <span class="stringliteral">&quot;*&quot;</span>);</div>
-<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;</div>
-<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;  <span class="keyword">static</span> <a class="code" href="classOption.html">Option&lt;Error&gt;</a> <a class="code" href="classmesos_1_1v1_1_1Resources.html#aa1501df2cd47829fcebb26410f38fa6e">validate</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
-<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;</div>
-<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;  <span class="keyword">static</span> <a class="code" href="classOption.html">Option&lt;Error&gt;</a> <a class="code" href="classmesos_1_1v1_1_1Resources.html#aa1501df2cd47829fcebb26410f38fa6e">validate</a>(</div>
-<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;      <span class="keyword">const</span> google::protobuf::RepeatedPtrField&lt;Resource&gt;&amp; resources);</div>
-<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;</div>
-<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;  <span class="comment">// NOTE: The following predicate functions assume that the given resource is</span></div>
-<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;  <span class="comment">// validated, and is in the &quot;post-reservation-refinement&quot; format. That is,</span></div>
-<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;  <span class="comment">// the reservation state is represented by `Resource.reservations` field,</span></div>
-<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;  <span class="comment">// and `Resource.role` and `Resource.reservation` fields are not set.</span></div>
-<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;  <span class="comment">//</span></div>
-<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;  <span class="comment">// See &#39;Resource Format&#39; section in `mesos.proto` for more details.</span></div>
-<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;</div>
-<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;  <span class="comment">// Tests if the given Resource object is empty.</span></div>
-<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a1122b880d0a01c919a35a41be0fa7b94">isEmpty</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
-<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;</div>
-<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;  <span class="comment">// Tests if the given Resource object is a persistent volume.</span></div>
-<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#ad2b1ead3063e0d52e43d93c3dc5fd070">isPersistentVolume</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
-<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;</div>
-<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;  <span class="comment">// Tests if the given Resource object is a disk of the specified type.</span></div>
-<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a01310b5316cfff0b6126115fc7f31046">isDisk</a>(</div>
-<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;      <span class="keyword">const</span> Resource&amp; resource,</div>
-<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;      <span class="keyword">const</span> <a class="code" href="namespacemesos_1_1internal_1_1capabilities.html#aaa5ec6d56ccbeba718b9e8fc6ec2f7c9">Resource::DiskInfo::Source::Type</a>&amp; <a class="code" href="namespacemesos_1_1internal_1_1fs.html#a2343e2642db514496ba8380776487fba">type</a>);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="comment">// Friend classes and functions for access to private members.</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a>;</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classmesos_1_1v1_1_1Resources.html#ae280811800456648b43c902fa7a42d46">operator&lt;&lt;</a>(</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        std::ostream&amp; stream, <span class="keyword">const</span> Resource_&amp; resource_);</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  <span class="keyword">private</span>:</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="comment">// The protobuf Resource that is being managed.</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    Resource resource;</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    <span class="comment">// The counter for grouping shared &#39;resource&#39; objects, None if the</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <span class="comment">// &#39;resource&#39; is non-shared. This is an int so as to support arithmetic</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="comment">// operations involving subtraction.</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <a class="code" href="classOption.html">Option&lt;int&gt;</a> sharedCount;</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;  };</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="keyword">public</span>:</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;  <span class="keyword">static</span> <a class="code" href="classTry.html">Try&lt;Resource&gt;</a> <a class="code" href="classmesos_1_1v1_1_1Resources.html#ada21773cbd96e5163fd54711282d9d91">parse</a>(</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;      <span class="keyword">const</span> std::string&amp; <a class="code" href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">name</a>,</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;      <span class="keyword">const</span> std::string&amp; value,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;      <span class="keyword">const</span> std::string&amp; role);</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;  <span class="keyword">static</span> <a class="code" href="classTry.html">Try&lt;Resources&gt;</a> <a class="code" href="classmesos_1_1v1_1_1Resources.html#ada21773cbd96e5163fd54711282d9d91">parse</a>(</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;      <span class="keyword">const</span> std::string&amp; text,</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;      <span class="keyword">const</span> std::string&amp; defaultRole = <span class="stringliteral">&quot;*&quot;</span>);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;  <span class="keyword">static</span> <a class="code" href="classTry.html">Try&lt;std::vector&lt;Resource&gt;</a>&gt; <a class="code" href="classmesos_1_1v1_1_1Resources.html#a013a0925b3375ede1d90f76f29d2d12e">fromJSON</a>(</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;      <span class="keyword">const</span> <a class="code" href="structJSON_1_1Array.html">JSON::Array</a>&amp; resourcesJSON,</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;      <span class="keyword">const</span> std::string&amp; defaultRole = <span class="stringliteral">&quot;*&quot;</span>);</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;  <span class="keyword">static</span> <a class="code" href="classTry.html">Try&lt;std::vector&lt;Resource&gt;</a>&gt; <a class="code" href="classmesos_1_1v1_1_1Resources.html#a4c8d1ca13522473ecbeaecf8f8b31f50">fromSimpleString</a>(</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;      <span class="keyword">const</span> std::string&amp; text,</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;      <span class="keyword">const</span> std::string&amp; defaultRole = <span class="stringliteral">&quot;*&quot;</span>);</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;  <span class="keyword">static</span> <a class="code" href="classTry.html">Try&lt;std::vector&lt;Resource&gt;</a>&gt; <a class="code" href="classmesos_1_1v1_1_1Resources.html#ad46385859813ded1f902075c266410c2">fromString</a>(</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;      <span class="keyword">const</span> std::string&amp; text,</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;      <span class="keyword">const</span> std::string&amp; defaultRole = <span class="stringliteral">&quot;*&quot;</span>);</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;  <span class="keyword">static</span> <a class="code" href="classOption.html">Option&lt;Error&gt;</a> <a class="code" href="classmesos_1_1v1_1_1Resources.html#aa1501df2cd47829fcebb26410f38fa6e">validate</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;  <span class="keyword">static</span> <a class="code" href="classOption.html">Option&lt;Error&gt;</a> <a class="code" href="classmesos_1_1v1_1_1Resources.html#aa1501df2cd47829fcebb26410f38fa6e">validate</a>(</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;      <span class="keyword">const</span> google::protobuf::RepeatedPtrField&lt;Resource&gt;&amp; resources);</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;  <span class="comment">// NOTE: The following predicate functions assume that the given resource is</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;  <span class="comment">// validated, and is in the &quot;post-reservation-refinement&quot; format. That is,</span></div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;  <span class="comment">// the reservation state is represented by `Resource.reservations` field,</span></div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;  <span class="comment">// and `Resource.role` and `Resource.reservation` fields are not set.</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;  <span class="comment">//</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;  <span class="comment">// See &#39;Resource Format&#39; section in `mesos.proto` for more details.</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;  <span class="comment">// Tests if the given Resource object is empty.</span></div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a1122b880d0a01c919a35a41be0fa7b94">isEmpty</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;  <span class="comment">// Tests if the given Resource object is a persistent volume.</span></div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#ad2b1ead3063e0d52e43d93c3dc5fd070">isPersistentVolume</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
 <div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;</div>
-<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;  <span class="comment">// Tests if the given Resource object is reserved. If the role is</span></div>
-<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;  <span class="comment">// specified, tests that it&#39;s reserved for the given role.</span></div>
-<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#ae75dcd85eda5807cdf12e42d2e354291">isReserved</a>(</div>
-<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;      <span class="keyword">const</span> Resource&amp; resource,</div>
-<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;      <span class="keyword">const</span> <a class="code" href="classOption.html">Option&lt;std::string&gt;</a>&amp; role = <a class="code" href="structNone.html">None</a>());</div>
-<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;</div>
-<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;  <span class="comment">// Tests if the given Resource object is allocatable to the given role.</span></div>
-<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;  <span class="comment">// A resource object is allocatable to &#39;role&#39; if:</span></div>
-<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;  <span class="comment">//   * it is reserved to an ancestor of that role in the hierarchy, OR</span></div>
-<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;  <span class="comment">//   * it is reserved to &#39;role&#39; itself, OR</span></div>
-<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;  <span class="comment">//   * it is unreserved.</span></div>
-<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a4fa6fa4b4da9acbc04e8faa7ad9dc24a">isAllocatableTo</a>(</div>
-<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;      <span class="keyword">const</span> Resource&amp; resource,</div>
-<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;      <span class="keyword">const</span> std::string&amp; role);</div>
-<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;</div>
-<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;  <span class="comment">// Tests if the given Resource object is unreserved.</span></div>
-<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a4ce7250b1e5eec3b0e3bc3a66fe4007b">isUnreserved</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
-<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;</div>
-<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;  <span class="comment">// Tests if the given Resource object is dynamically reserved.</span></div>
-<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#ab691d1c2fa2629190347c19dcc6a385f">isDynamicallyReserved</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
-<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;</div>
-<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;  <span class="comment">// Tests if the given Resource object is revocable.</span></div>
-<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#aafe883992970766fad47c0f1bff39998">isRevocable</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
-<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;</div>
-<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;  <span class="comment">// Tests if the given Resource object is shared.</span></div>
-<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a3b642920fe195dca5e142ba9f1bf0445">isShared</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
-<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;</div>
-<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;  <span class="comment">// Tests if the given Resource object has refined reservations.</span></div>
-<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a497e25b377bf0b52d3356972f2f49df8">hasRefinedReservations</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
-<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;</div>
-<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;  <span class="comment">// Tests if the given Resource object is provided by a resource provider.</span></div>
-<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a54217a6501a0f7fad946eacd893ecb67">hasResourceProvider</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
-<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;</div>
-<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;  <span class="comment">// Returns the role to which the given Resource object is reserved for.</span></div>
-<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;  <span class="comment">// This must be called only when the resource is reserved!</span></div>
-<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> std::string&amp; <a class="code" href="classmesos_1_1v1_1_1Resources.html#a7ed33a126401a10668cb4194f158eda0">reservationRole</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
-<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;</div>
-<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;  <span class="comment">// Returns the summed up Resources given a hashmap&lt;Key, Resources&gt;.</span></div>
-<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;  <span class="comment">//</span></div>
-<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;  <span class="comment">// NOTE: While scalar resources such as &quot;cpus&quot; sum correctly,</span></div>
-<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;  <span class="comment">// non-scalar resources such as &quot;ports&quot; do not.</span></div>
-<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;  <span class="comment">//   e.g. &quot;cpus:2&quot; + &quot;cpus:1&quot; = &quot;cpus:3&quot;</span></div>
-<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;  <span class="comment">//        &quot;ports:[0-100]&quot; + &quot;ports:[0-100]&quot; = &quot;ports:[0-100]&quot;</span></div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;  <span class="comment">// Tests if the given Resource object is a disk of the specified type.</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a01310b5316cfff0b6126115fc7f31046">isDisk</a>(</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;      <span class="keyword">const</span> Resource&amp; resource,</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;      <span class="keyword">const</span> <a class="code" href="namespacemesos_1_1internal_1_1capabilities.html#aaa5ec6d56ccbeba718b9e8fc6ec2f7c9">Resource::DiskInfo::Source::Type</a>&amp; <a class="code" href="namespacemesos_1_1internal_1_1fs.html#a2343e2642db514496ba8380776487fba">type</a>);</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;  <span class="comment">// Tests if the given Resource object is reserved. If the role is</span></div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;  <span class="comment">// specified, tests that it&#39;s reserved for the given role.</span></div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#ae75dcd85eda5807cdf12e42d2e354291">isReserved</a>(</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;      <span class="keyword">const</span> Resource&amp; resource,</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;      <span class="keyword">const</span> <a class="code" href="classOption.html">Option&lt;std::string&gt;</a>&amp; role = <a class="code" href="structNone.html">None</a>());</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;  <span class="comment">// Tests if the given Resource object is allocatable to the given role.</span></div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;  <span class="comment">// A resource object is allocatable to &#39;role&#39; if:</span></div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;  <span class="comment">//   * it is reserved to an ancestor of that role in the hierarchy, OR</span></div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;  <span class="comment">//   * it is reserved to &#39;role&#39; itself, OR</span></div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;  <span class="comment">//   * it is unreserved.</span></div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a4fa6fa4b4da9acbc04e8faa7ad9dc24a">isAllocatableTo</a>(</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;      <span class="keyword">const</span> Resource&amp; resource,</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;      <span class="keyword">const</span> std::string&amp; role);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;  <span class="comment">// Tests if the given Resource object is unreserved.</span></div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a4ce7250b1e5eec3b0e3bc3a66fe4007b">isUnreserved</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;  <span class="comment">// Tests if the given Resource object is dynamically reserved.</span></div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#ab691d1c2fa2629190347c19dcc6a385f">isDynamicallyReserved</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;  <span class="comment">// Tests if the given Resource object is revocable.</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#aafe883992970766fad47c0f1bff39998">isRevocable</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;  <span class="comment">// Tests if the given Resource object is shared.</span></div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a3b642920fe195dca5e142ba9f1bf0445">isShared</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;  <span class="comment">// Tests if the given Resource object has refined reservations.</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a497e25b377bf0b52d3356972f2f49df8">hasRefinedReservations</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;  <span class="comment">// Tests if the given Resource object is provided by a resource provider.</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a54217a6501a0f7fad946eacd893ecb67">hasResourceProvider</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;  <span class="comment">// Returns the role to which the given Resource object is reserved for.</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;  <span class="comment">// This must be called only when the resource is reserved!</span></div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> std::string&amp; <a class="code" href="classmesos_1_1v1_1_1Resources.html#a7ed33a126401a10668cb4194f158eda0">reservationRole</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;  <span class="comment">// Returns the summed up Resources given a hashmap&lt;Key, Resources&gt;.</span></div>
 <div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;  <span class="comment">//</span></div>
-<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;  <span class="comment">// TODO(mpark): Deprecate this function once we introduce the</span></div>
-<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;  <span class="comment">// concept of &quot;cluster-wide&quot; resources which provides correct</span></div>
-<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;  <span class="comment">// semantics for summation over all types of resources. (e.g.</span></div>
-<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;  <span class="comment">// non-scalar)</span></div>
-<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Key&gt;</div>
-<div class="line"><a name="l00333"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html#acae32482500bf65bd41786fe07a480c9">  333</a></span>&#160;  <span class="keyword">static</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a> <a class="code" href="classmesos_1_1v1_1_1Resources.html#acae32482500bf65bd41786fe07a480c9">sum</a>(<span class="keyword">const</span> <a class="code" href="classhashmap.html">hashmap&lt;Key, Resources&gt;</a>&amp; _resources)</div>
-<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;  {</div>
-<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;    <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a> result;</div>
-<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;</div>
-<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;    <a class="code" href="foreach_8hpp.html#a28670619e64a84270d76f07b0f6eb3b6">foreachvalue</a> (<span class="keyword">const</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a>&amp; resources, _resources) {</div>
-<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;      result += resources;</div>
-<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;    }</div>
-<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;</div>
-<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;    <span class="keywordflow">return</span> result;</div>
-<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;  }</div>
-<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;</div>
-<div class="line"><a name="l00344"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html#afb96448b026e8b78e338cf82bfc47e7a">  344</a></span>&#160;  <a class="code" href="classmesos_1_1v1_1_1Resources.html#afb96448b026e8b78e338cf82bfc47e7a">Resources</a>() {}</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;  <span class="comment">// NOTE: While scalar resources such as &quot;cpus&quot; sum correctly,</span></div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;  <span class="comment">// non-scalar resources such as &quot;ports&quot; do not.</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;  <span class="comment">//   e.g. &quot;cpus:2&quot; + &quot;cpus:1&quot; = &quot;cpus:3&quot;</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;  <span class="comment">//        &quot;ports:[0-100]&quot; + &quot;ports:[0-100]&quot; = &quot;ports:[0-100]&quot;</span></div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;  <span class="comment">//</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;  <span class="comment">// TODO(mpark): Deprecate this function once we introduce the</span></div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;  <span class="comment">// concept of &quot;cluster-wide&quot; resources which provides correct</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;  <span class="comment">// semantics for summation over all types of resources. (e.g.</span></div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;  <span class="comment">// non-scalar)</span></div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Key&gt;</div>
+<div class="line"><a name="l00338"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html#acae32482500bf65bd41786fe07a480c9">  338</a></span>&#160;  <span class="keyword">static</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a> <a class="code" href="classmesos_1_1v1_1_1Resources.html#acae32482500bf65bd41786fe07a480c9">sum</a>(<span class="keyword">const</span> <a class="code" href="classhashmap.html">hashmap&lt;Key, Resources&gt;</a>&amp; _resources)</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;  {</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;    <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a> result;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;    <a class="code" href="foreach_8hpp.html#a28670619e64a84270d76f07b0f6eb3b6">foreachvalue</a> (<span class="keyword">const</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a>&amp; resources, _resources) {</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;      result += resources;</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;    }</div>
 <div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;</div>
-<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;  <span class="comment">// TODO(jieyu): Consider using C++11 initializer list.</span></div>
-<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;  <span class="comment">/*implicit*/</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#afb96448b026e8b78e338cf82bfc47e7a">Resources</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;    <span class="keywordflow">return</span> result;</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;  }</div>
 <div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;</div>
-<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;  <span class="comment">/*implicit*/</span></div>
-<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;  <a class="code" href="classmesos_1_1v1_1_1Resources.html#afb96448b026e8b78e338cf82bfc47e7a">Resources</a>(<span class="keyword">const</span> std::vector&lt;Resource&gt;&amp; _resources);</div>
-<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;</div>
-<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;  <span class="comment">/*implicit*/</span></div>
-<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;  <a class="code" href="classmesos_1_1v1_1_1Resources.html#afb96448b026e8b78e338cf82bfc47e7a">Resources</a>(<span class="keyword">const</span> google::protobuf::RepeatedPtrField&lt;Resource&gt;&amp; _resources);</div>
-<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;</div>
-<div class="line"><a name="l00355"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html#a5770adc8a5ab3730cc3eb34656907828">  355</a></span>&#160;  <a class="code" href="classmesos_1_1v1_1_1Resources.html#a5770adc8a5ab3730cc3eb34656907828">Resources</a>(<span class="keyword">const</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a>&amp; that) : resources(that.resources) {}</div>
+<div class="line"><a name="l00349"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html#afb96448b026e8b78e338cf82bfc47e7a">  349</a></span>&#160;  <a class="code" href="classmesos_1_1v1_1_1Resources.html#afb96448b026e8b78e338cf82bfc47e7a">Resources</a>() {}</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;  <span class="comment">// TODO(jieyu): Consider using C++11 initializer list.</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;  <span class="comment">/*implicit*/</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#afb96448b026e8b78e338cf82bfc47e7a">Resources</a>(<span class="keyword">const</span> Resource&amp; resource);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;  <span class="comment">/*implicit*/</span></div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;  <a class="code" href="classmesos_1_1v1_1_1Resources.html#afb96448b026e8b78e338cf82bfc47e7a">Resources</a>(<span class="keyword">const</span> std::vector&lt;Resource&gt;&amp; _resources);</div>
 <div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;</div>
-<div class="line"><a name="l00357"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html#a67c9b3a515ef7ca50599151b7039ff5f">  357</a></span>&#160;  <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a>&amp; <a class="code" href="classmesos_1_1v1_1_1Resources.html#a67c9b3a515ef7ca50599151b7039ff5f">operator=</a>(<span class="keyword">const</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a>&amp; that)</div>
-<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;  {</div>
-<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;    <span class="keywordflow">if</span> (<span class="keyword">this</span> != &amp;that) {</div>
-<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;      resources = that.resources;</div>
-<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;    }</div>
-<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
-<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;  }</div>
-<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;</div>
-<div class="line"><a name="l00365"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html#a78a139b6c5f9277afd1521a65deced5e">  365</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a78a139b6c5f9277afd1521a65deced5e">empty</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> resources.size() == 0; }</div>
-<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;</div>
-<div class="line"><a name="l00367"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html#af83efda9ce0e171eeebc0741c5b63a2f">  367</a></span>&#160;  <span class="keywordtype">size_t</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#af83efda9ce0e171eeebc0741c5b63a2f">size</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> resources.size(); }</div>
-<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;</div>
-<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;  <span class="comment">// Checks if this Resources is a superset of the given Resources.</span></div>
-<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#acc7fd5ead44f48cc44ad2169b5d0b5c3">contains</a>(<span class="keyword">const</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a>&amp; that) <span class="keyword">const</span>;</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;  <span class="comment">/*implicit*/</span></div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;  <a class="code" href="classmesos_1_1v1_1_1Resources.html#afb96448b026e8b78e338cf82bfc47e7a">Resources</a>(<span class="keyword">const</span> google::protobuf::RepeatedPtrField&lt;Resource&gt;&amp; _resources);</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;</div>
+<div class="line"><a name="l00360"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html#a5770adc8a5ab3730cc3eb34656907828">  360</a></span>&#160;  <a class="code" href="classmesos_1_1v1_1_1Resources.html#a5770adc8a5ab3730cc3eb34656907828">Resources</a>(<span class="keyword">const</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a>&amp; that) : resources(that.resources) {}</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;</div>
+<div class="line"><a name="l00362"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html#a67c9b3a515ef7ca50599151b7039ff5f">  362</a></span>&#160;  <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a>&amp; <a class="code" href="classmesos_1_1v1_1_1Resources.html#a67c9b3a515ef7ca50599151b7039ff5f">operator=</a>(<span class="keyword">const</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a>&amp; that)</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;  {</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;    <span class="keywordflow">if</span> (<span class="keyword">this</span> != &amp;that) {</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;      resources = that.resources;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;    }</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;  }</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;</div>
+<div class="line"><a name="l00370"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html#a78a139b6c5f9277afd1521a65deced5e">  370</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a78a139b6c5f9277afd1521a65deced5e">empty</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> resources.size() == 0; }</div>
 <div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;</div>
-<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;  <span class="comment">// Checks if this Resources contains the given Resource.</span></div>
-<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#acc7fd5ead44f48cc44ad2169b5d0b5c3">contains</a>(<span class="keyword">const</span> Resource&amp; that) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;</div>
-<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;  <span class="comment">// Count the Resource objects that match the specified value.</span></div>
-<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;  <span class="comment">//</span></div>
-<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;  <span class="comment">// NOTE:</span></div>
-<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;  <span class="comment">// - For a non-shared resource the count can be at most 1 because all</span></div>
-<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;  <span class="comment">//   non-shared Resource objects in Resources are unique.</span></div>
-<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;  <span class="comment">// - For a shared resource the count can be greater than 1.</span></div>
-<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;  <span class="comment">// - If the resource is not in the Resources object, the count is 0.</span></div>
-<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;  <span class="keywordtype">size_t</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#ad0b18d1969e50825f07aa3165875114e">count</a>(<span class="keyword">const</span> Resource&amp; that) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;</div>
-<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;  <span class="comment">// Allocates the resources to the given role (by setting the</span></div>
-<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;  <span class="comment">// `AllocationInfo.role`). Any existing allocation will be</span></div>
-<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;  <span class="comment">// over-written.</span></div>
-<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a34e9581de822e7174764be420ae6b967">allocate</a>(<span class="keyword">const</span> std::string&amp; role);</div>
+<div class="line"><a name="l00372"></a><span class="lineno"><a class="line" href="classmesos_1_1v1_1_1Resources.html#af83efda9ce0e171eeebc0741c5b63a2f">  372</a></span>&#160;  <span class="keywordtype">size_t</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#af83efda9ce0e171eeebc0741c5b63a2f">size</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> resources.size(); }</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;  <span class="comment">// Checks if this Resources is a superset of the given Resources.</span></div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#acc7fd5ead44f48cc44ad2169b5d0b5c3">contains</a>(<span class="keyword">const</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a>&amp; that) <span class="keyword">const</span>;</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;  <span class="comment">// Checks if this Resources contains the given Resource.</span></div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#acc7fd5ead44f48cc44ad2169b5d0b5c3">contains</a>(<span class="keyword">const</span> Resource&amp; that) <span class="keyword">const</span>;</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;  <span class="comment">// Count the Resource objects that match the specified value.</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;  <span class="comment">//</span></div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;  <span class="comment">// NOTE:</span></div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;  <span class="comment">// - For a non-shared resource the count can be at most 1 because all</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;  <span class="comment">//   non-shared Resource objects in Resources are unique.</span></div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;  <span class="comment">// - For a shared resource the count can be greater than 1.</span></div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;  <span class="comment">// - If the resource is not in the Resources object, the count is 0.</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;  <span class="keywordtype">size_t</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#ad0b18d1969e50825f07aa3165875114e">count</a>(<span class="keyword">const</span> Resource&amp; that) <span class="keyword">const</span>;</div>
 <div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;</div>
-<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;  <span class="comment">// Unallocates the resources.</span></div>
-<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classmesos_1_1v1_1_1Resources.html#ac258ec47ef7d83bff7c52b2958608144">unallocate</a>();</div>
-<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;</div>
-<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;  <span class="comment">// Filter resources based on the given predicate.</span></div>
-<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;  <a class="code" href="classmesos_1_1v1_1_1Resources.html">Resources</a> <a class="code" href="classmesos_1_1v1_1_1Resources.html#a955c4d70ae7a7d1736a5af78b8365483">filter</a>(</div>
-<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;      <span class="keyword">const</span> lambda::function&lt;<span class="keywordtype">bool</span>(<span class="keyword">const</span> Resource&amp;)&gt;&amp; predicate) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;</div>
-<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;  <span class="comment">// Returns the reserved resources, by role.</span></div>
-<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;  <a class="code" href="classhashmap.html">hashmap&lt;std::string, Resources&gt;</a> <a class="code" href="classmesos_1_1v1_1_1Res

<TRUNCATED>

Mime
View raw message