@@ -31,6 +31,11 @@ EvaluationDetailInternal const& EvaluationResult::Detail() const {
3131 return detail_;
3232}
3333
34+ std::optional<std::vector<std::string>> const & EvaluationResult::Prerequisites ()
35+ const {
36+ return prerequisites_;
37+ }
38+
3439EvaluationResult::EvaluationResult (
3540 uint64_t version,
3641 std::optional<uint64_t > flag_version,
@@ -39,12 +44,30 @@ EvaluationResult::EvaluationResult(
3944 std::optional<std::chrono::time_point<std::chrono::system_clock>>
4045 debug_events_until_date,
4146 EvaluationDetailInternal detail)
47+ : EvaluationResult(version,
48+ flag_version,
49+ track_events,
50+ track_reason,
51+ debug_events_until_date,
52+ std::move (detail),
53+ {}) {}
54+
55+ EvaluationResult::EvaluationResult (
56+ uint64_t version,
57+ std::optional<uint64_t > flag_version,
58+ bool track_events,
59+ bool track_reason,
60+ std::optional<std::chrono::time_point<std::chrono::system_clock>>
61+ debug_events_until_date,
62+ EvaluationDetailInternal detail,
63+ std::optional<std::vector<std::string>> prerequisites)
4264 : version_(version),
4365 flag_version_ (flag_version),
4466 track_events_(track_events),
4567 track_reason_(track_reason),
4668 debug_events_until_date_(debug_events_until_date),
47- detail_(std::move(detail)) {}
69+ detail_(std::move(detail)),
70+ prerequisites_(std::move(prerequisites)) {}
4871
4972std::ostream& operator <<(std::ostream& out, EvaluationResult const & result) {
5073 out << " {" ;
@@ -59,6 +82,14 @@ std::ostream& operator<<(std::ostream& out, EvaluationResult const& result) {
5982 << std::put_time (std::gmtime (&as_time_t ), " %Y-%m-%d %H:%M:%S" );
6083 }
6184 out << " detail: " << result.Detail ();
85+ if (auto const prerequisites = result.Prerequisites ()) {
86+ out << " prerequisites: [" ;
87+ for (std::size_t i = 0 ; i < prerequisites->size (); i++) {
88+ out << prerequisites->at (i)
89+ << (i == prerequisites->size () - 1 ? " " : " , " );
90+ }
91+ out << " ]" ;
92+ }
6293 out << " }" ;
6394 return out;
6495}
@@ -69,7 +100,8 @@ bool operator==(EvaluationResult const& lhs, EvaluationResult const& rhs) {
69100 lhs.TrackEvents () == rhs.TrackEvents () &&
70101 lhs.Detail () == rhs.Detail () &&
71102 lhs.DebugEventsUntilDate () == rhs.DebugEventsUntilDate () &&
72- lhs.FlagVersion () == rhs.FlagVersion ();
103+ lhs.FlagVersion () == rhs.FlagVersion () &&
104+ lhs.Prerequisites () == rhs.Prerequisites ();
73105}
74106
75107bool operator !=(EvaluationResult const & lhs, EvaluationResult const & rhs) {
0 commit comments