...
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user