diff --git a/cxx/asibfm700_mount.cpp b/cxx/asibfm700_mount.cpp index d342a5d..cf71336 100644 --- a/cxx/asibfm700_mount.cpp +++ b/cxx/asibfm700_mount.cpp @@ -7,12 +7,12 @@ template AsibFM700Mount::AsibFM700Mount(AsibFM700Config config, std::shared_ptr logger, const R& pattern_range) : mcc::utils::MccSpdlogLogger(std::move(logger), pattern_range), _currentConfig(std::move(config)), - base_gm_t(std::make_tuple(_currentConfig.astromEngineState), - std::make_tuple(_currentConfig.hardwareConfig), - std::make_tuple(_currentConfig.pecData), - std::make_tuple(std::ref(_astromEngine), std::ref(_pec), std::ref(_hardware)), - std::make_tuple(std::ref(_telemetry), std::ref(_hardware), std::ref(_pzFuncs)), - std::make_tuple(std::ref(_telemetry), std::ref(_hardware), std::ref(_pzFuncs))) + base_gm_t({_currentConfig.astromEngineState}, + {_currentConfig.hardwareConfig}, + {_currentConfig.pecData}, + AsibFM700Telemetry{_astromEngine, _pec, _hardware}, + slew_model_t{_telemetry, _hardware, _pzFuncs}, + guiding_model_t{_telemetry, _hardware, _pzFuncs}) { } diff --git a/cxx/asibfm700_mount.h b/cxx/asibfm700_mount.h index 0dcb2c9..d98aad2 100644 --- a/cxx/asibfm700_mount.h +++ b/cxx/asibfm700_mount.h @@ -29,6 +29,9 @@ class AsibFM700Mount : public mcc::utils::MccSpdlogLogger, AsibFM700GuidingModel>; public: + typedef AsibFM700SlewModel slew_model_t; + typedef AsibFM700GuidingModel guiding_model_t; + template AsibFM700Mount(AsibFM700Config config, std::shared_ptr logger, diff --git a/cxx/mcc_generic_mount.h b/cxx/mcc_generic_mount.h index cfc60f4..85f885a 100644 --- a/cxx/mcc_generic_mount.h +++ b/cxx/mcc_generic_mount.h @@ -32,6 +32,22 @@ struct MccPZoneWrapper { pz_inzone_func_t inZone; pz_timeto_func_t timeTo; pz_timefrom_func_t timeFrom; + + MccPZoneWrapper(MccPZoneWrapper&& other) + : inZone(std::move(other.inZone)), timeTo(std::move(other.timeTo)), timeFrom(std::move(other.timeFrom)) {}; + + MccPZoneWrapper& operator=(MccPZoneWrapper&& other) + { + if (this != &other) { + inZone = std::move(other.inZone); + timeTo = std::move(other.timeTo); + timeFrom = std::move(other.timeFrom); + } + + return *this; + }; + + MccPZoneWrapper() = default; }; @@ -56,24 +72,18 @@ public: static constexpr MccMountType mountType = pec_t::mountType; - template - MccGenericMount(ASTROM_ENGINE_CTOR_T aengine_ctor_args, - HARDWARE_CTOR_T hw_ctor_args, - PEC_CTOR_T pec_ctor_args, - TELEMETRY_CTOR_T t_ctor_args, - SLEWMODEL_CTOR_T smodel_ctor_args, - GUIDINGMODEL_CTOR_T gmodel_ctor_args) - : _astromEngine(std::make_from_tuple(std::move(aengine_ctor_args))), - _hardware(std::make_from_tuple(std::move(hw_ctor_args))), - _pec(std::make_from_tuple(std::move(pec_ctor_args))), - _telemetry(std::make_from_tuple(std::move(t_ctor_args))), - _slewModel(std::make_from_tuple(std::move(smodel_ctor_args))), - _guidingModel(std::make_from_tuple(std::move(gmodel_ctor_args))) + MccGenericMount(ASTROM_ENGINE_T aengine, + HARDWARE_T hw, + PEC_T pec, + TELEMETRY_T tmtry, + SLEWMODEL_T smodel, + GUIDINGMODEL_T gmodel) + : _astromEngine(std::move(aengine)), + _hardware(std::move(hw)), + _pec(std::move(pec)), + _telemetry(std::move(tmtry)), + _slewModel(std::move(smodel)), + _guidingModel(std::move(gmodel)) { } diff --git a/cxx/mcc_guiding_model.h b/cxx/mcc_guiding_model.h index db9788c..1d3f9dc 100644 --- a/cxx/mcc_guiding_model.h +++ b/cxx/mcc_guiding_model.h @@ -116,7 +116,8 @@ public: template PZ_T, + // traits::mcc_tuple_c PZ_T, typename... LoggerCtorArgTs> MccSimpleGuidingModel(TELEMETRY_T& telemetry, HARDWARE_T& hardware, @@ -132,7 +133,9 @@ public: template + traits::mcc_irange_of_pzones_c PZ_T + // traits::mcc_tuple_c PZ_T + > MccSimpleGuidingModel(TELEMETRY_T& telemetry, HARDWARE_T& hardware, PZ_T& prohibited_zone) requires(std::same_as) { diff --git a/cxx/mcc_mount_concepts.h b/cxx/mcc_mount_concepts.h index f36bee1..f9c5dde 100644 --- a/cxx/mcc_mount_concepts.h +++ b/cxx/mcc_mount_concepts.h @@ -429,7 +429,7 @@ concept mcc_prohibited_zone_c = // static constexpr member to represent inifite duration requires requires { - requires std::same_as; + requires std::same_as; []() { constexpr auto val = T::infiniteDuration; return val; @@ -438,7 +438,7 @@ concept mcc_prohibited_zone_c = // static constexpr member to represent zero duration requires requires { - requires std::same_as; + requires std::same_as; []() { constexpr auto val = T::zeroDuration; return val; @@ -449,13 +449,13 @@ concept mcc_prohibited_zone_c = // the type 'T' must define a static constexpr member of type MccCoordPairKind // to declarate type of coordinate pair used to describe the zone. // This coordinate pair must be used as input in the 'inZone' class method. - requires requires { - requires std::same_as; - []() { - constexpr MccCoordPairKind val = T::zoneCoordPairKind; - return val; - }(); // to ensure that 'zoneCoordPairKind' can be used at compile-time context - }; + // requires requires { + // requires std::same_as; + // []() { + // constexpr MccCoordPairKind val = T::zoneCoordPairKind; + // return val; + // }(); // to ensure that 'zoneCoordPairKind' can be used at compile-time context + // }; // return a name of the zone { t_const.name() } -> mcc_formattable; diff --git a/cxx/mcc_mount_pz.h b/cxx/mcc_mount_pz.h index a022225..8b358f7 100644 --- a/cxx/mcc_mount_pz.h +++ b/cxx/mcc_mount_pz.h @@ -243,4 +243,6 @@ private: typedef MccAltLimitPZ MccMinAltPZ; typedef MccAltLimitPZ MccMaxAltPZ; +static_assert(std::movable); + } // namespace mcc diff --git a/cxx/mcc_slew_model.h b/cxx/mcc_slew_model.h index 55109a4..97de93a 100644 --- a/cxx/mcc_slew_model.h +++ b/cxx/mcc_slew_model.h @@ -126,7 +126,8 @@ public: template PZ_T, + // traits::mcc_tuple_c PZ_T, // std::tuple of prohibited zones typename... LoggerCtorArgTs> MccSimpleSlewModel(TELEMETRY_T& telemetry, HARDWARE_T& hardware, @@ -142,7 +143,8 @@ public: template PZ_T + // traits::mcc_tuple_c PZ_T // std::tuple of prohibited zones > MccSimpleSlewModel(TELEMETRY_T& telemetry, HARDWARE_T& hardware, PZ_T& prohibited_zone) requires(std::same_as)