You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2016/10/06 00:52:40 UTC
mesos git commit: Updated comments for Resources::add and
Resources::subtract.
Repository: mesos
Updated Branches:
refs/heads/master 945e8929a -> 410857ada
Updated comments for Resources::add and Resources::subtract.
The `Resources` API for += and -= against a `Resource` object are
now removed, this notes that the `add` and `subtract` functions are
how the caller can add or subtract a `Resource`.
Review: https://reviews.apache.org/r/51877/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/410857ad
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/410857ad
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/410857ad
Branch: refs/heads/master
Commit: 410857ada5d45ed65abe35d8748b202dc343884c
Parents: 945e892
Author: Guangya Liu <gy...@gmail.com>
Authored: Wed Oct 5 17:45:57 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Wed Oct 5 17:52:25 2016 -0700
----------------------------------------------------------------------
include/mesos/resources.hpp | 3 +++
include/mesos/v1/resources.hpp | 3 +++
2 files changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/410857ad/include/mesos/resources.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/resources.hpp b/include/mesos/resources.hpp
index 3ef8cac..4a994d0 100644
--- a/include/mesos/resources.hpp
+++ b/include/mesos/resources.hpp
@@ -508,6 +508,9 @@ private:
// Validation-free versions of += and -= `Resource_` operators.
// These can be used when `r` is already validated.
+ //
+ // NOTE: `Resource` objects are implicitly converted to `Resource_`
+ // objects, so here the API can also accept a `Resource` object.
void add(const Resource_& r);
void subtract(const Resource_& r);
http://git-wip-us.apache.org/repos/asf/mesos/blob/410857ad/include/mesos/v1/resources.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/v1/resources.hpp b/include/mesos/v1/resources.hpp
index ef56b49..8598587 100644
--- a/include/mesos/v1/resources.hpp
+++ b/include/mesos/v1/resources.hpp
@@ -508,6 +508,9 @@ private:
// Validation-free versions of += and -= `Resource_` operators.
// These can be used when `r` is already validated.
+ //
+ // NOTE: `Resource` objects are implicitly converted to `Resource_`
+ // objects, so here the API can also accept a `Resource` object.
void add(const Resource_& r);
void subtract(const Resource_& r);