Replace rtc:🦗:Settable with rtc::Maybe

The former is very similar to the latter, but less general (mostly in
naming).

This CL, which is the first to use Maybe at scale, also removes the implicit conversion from T to Maybe<T>, since it was agreed that the increased verbosity increased legibility.

Review URL: https://codereview.webrtc.org/1430433004

Cr-Commit-Position: refs/heads/master@{#10461}
This commit is contained in:
kwiberg
2015-10-30 02:47:38 -07:00
committed by Commit bot
parent bdafe31b86
commit 102c6a61bc
20 changed files with 450 additions and 543 deletions

View File

@ -68,7 +68,7 @@ rtc::Maybe<Point> GetDirectionIfLinear(
return rtc::Maybe<Point>();
}
}
return first_pair_direction;
return rtc::Maybe<Point>(first_pair_direction);
}
rtc::Maybe<Point> GetNormalIfPlanar(const std::vector<Point>& array_geometry) {
@ -95,14 +95,14 @@ rtc::Maybe<Point> GetNormalIfPlanar(const std::vector<Point>& array_geometry) {
return rtc::Maybe<Point>();
}
}
return normal_direction;
return rtc::Maybe<Point>(normal_direction);
}
rtc::Maybe<Point> GetArrayNormalIfExists(
const std::vector<Point>& array_geometry) {
const rtc::Maybe<Point> direction = GetDirectionIfLinear(array_geometry);
if (direction) {
return Point(direction->y(), -direction->x(), 0.f);
return rtc::Maybe<Point>(Point(direction->y(), -direction->x(), 0.f));
}
const rtc::Maybe<Point> normal = GetNormalIfPlanar(array_geometry);
if (normal && normal->z() < kMaxDotProduct) {