This commit is contained in:
2025-04-21 18:36:47 +03:00
parent f2a7806f5f
commit 67340d1926
4 changed files with 225 additions and 6 deletions

View File

@@ -4,6 +4,43 @@
namespace mcc
{
namespace traits
{
template <typename T>
concept mcc_prohibited_zone_c = requires(T t, const T const_t) {
typename T::pzcoords_kind_t;
{ const_t.name() } -> std::same_as<std::string_view>;
{ const_t.desc() } -> std::same_as<std::string_view>;
// check if given coordinates are within the zone
{
t.inZone(std::declval<const MccCoordinate&>(), std::declval<const MccCoordinate&>(),
std::declval<typename T::pzcoords_kind_t>())
} -> std::convertible_to<bool>;
// a time duration to reach the zone (0 - if already in the zone, chrono::duration<>::max() if never
// reach the zone)
{
t.timeTo(std::declval<const MccCoordinate&>(), std::declval<const MccCoordinate&>(),
std::declval<typename T::pzcoords_kind_t>(),
std::declval<const std::chrono::system_clock::time_point&>())
} -> mcc_time_duration_c;
// a time duration to exit the zone (0 - if already out of the zone, chrono::duration<>::max() if
// never exit the zone)
{
t.timeFrom(std::declval<const MccCoordinate&>(), std::declval<const MccCoordinate&>(),
std::declval<typename T::pzcoords_kind_t>(),
std::declval<const std::chrono::system_clock::time_point&>())
} -> mcc_time_duration_c;
};
} // namespace traits
class MccProhibitedZone
{
public: