This commit is contained in:
Timur A. Fatkhullin
2026-02-16 01:33:06 +03:00
parent 66e5f37c74
commit 82f1477edd
3 changed files with 575 additions and 9 deletions

View File

@@ -144,6 +144,8 @@ public:
return MccPZoneContainerErrorCode::ERROR_OK;
});
_names.push_back(std::format("{}", zone.pzoneName));
return _inZoneFunc.size();
}
@@ -152,9 +154,16 @@ public:
_inZoneFunc.clear();
_timeToZoneFunc.clear();
_timeFromZoneFunc.clear();
_names.clear();
}
std::vector<std::string> pzoneNames() const
{
return _names;
}
error_t inPZone(mcc_skypoint_c auto const& coords, bool* at_least_one, std::ranges::output_range<bool> auto* result)
{
auto err = forEach(_inZoneFunc, coords, result);
@@ -188,9 +197,11 @@ public:
protected:
typedef std::chrono::nanoseconds duration_t;
std::vector<std::function<error_t(MccSkyPoint const& pt, bool*)>> _inZoneFunc;
std::vector<std::function<error_t(MccSkyPoint const& pt, duration_t*)>> _timeToZoneFunc;
std::vector<std::function<error_t(MccSkyPoint const& pt, duration_t*)>> _timeFromZoneFunc;
std::vector<std::function<error_t(MccSkyPoint const& pt, bool*)>> _inZoneFunc{};
std::vector<std::function<error_t(MccSkyPoint const& pt, duration_t*)>> _timeToZoneFunc{};
std::vector<std::function<error_t(MccSkyPoint const& pt, duration_t*)>> _timeFromZoneFunc{};
std::vector<std::string> _names{};
error_t forEach(auto& func_cont, MccSkyPoint const& pt, auto* result)
{
@@ -205,7 +216,7 @@ protected:
res_elem_t res_elem;
size_t res_sz = std::ranges::size(*result);
// size_t res_sz = std::ranges::size(*result);
auto it = result->begin();
for (auto& func : func_cont) {