Added << operator to stringify v1::TaskGroupInfo protobuf. This patch is needed as Flags add() function needs to stringify v1::TaskGroupInfo before it is parsed to a variable of that type.
Review: https://reviews.apache.org/r/51990/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e84c2c45 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e84c2c45 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e84c2c45 Branch: refs/heads/master Commit: e84c2c451dbb971ec91a70ef6c077b4a666ae311 Parents: 9a9610d Author: Abhishek Dasgupta <a10gu...@linux.vnet.ibm.com> Authored: Mon Sep 19 13:31:38 2016 -0700 Committer: Vinod Kone <vinodk...@gmail.com> Committed: Mon Sep 19 13:31:38 2016 -0700 ---------------------------------------------------------------------- include/mesos/v1/mesos.hpp | 5 +++++ src/v1/mesos.cpp | 6 ++++++ 2 files changed, 11 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/e84c2c45/include/mesos/v1/mesos.hpp ---------------------------------------------------------------------- diff --git a/include/mesos/v1/mesos.hpp b/include/mesos/v1/mesos.hpp index 936af77..f171458 100644 --- a/include/mesos/v1/mesos.hpp +++ b/include/mesos/v1/mesos.hpp @@ -285,6 +285,11 @@ std::ostream& operator<<(std::ostream& stream, const MachineID& machineId); std::ostream& operator<<(std::ostream& stream, const TaskInfo& task); +std::ostream& operator<<( + std::ostream& stream, + const TaskGroupInfo& taskGroupInfo); + + std::ostream& operator<<(std::ostream& stream, const TaskState& state); http://git-wip-us.apache.org/repos/asf/mesos/blob/e84c2c45/src/v1/mesos.cpp ---------------------------------------------------------------------- diff --git a/src/v1/mesos.cpp b/src/v1/mesos.cpp index c6a8799..0f88aba 100644 --- a/src/v1/mesos.cpp +++ b/src/v1/mesos.cpp @@ -468,6 +468,12 @@ ostream& operator<<(ostream& stream, const TaskInfo& task) } +ostream& operator<<(ostream& stream, const TaskGroupInfo& taskGroupInfo) +{ + return stream << taskGroupInfo.DebugString(); +} + + ostream& operator<<(ostream& stream, const TaskState& state) { return stream << TaskState_Name(state);