From fe6c106efcde47f858c00431a35fca08562bd66e Mon Sep 17 00:00:00 2001 From: Julien Lamy Date: Wed, 1 Nov 2023 11:07:34 +0100 Subject: [PATCH] Add default constructor to TimeInterval --- src/sycomore/TimeInterval.cpp | 6 ++++++ src/sycomore/TimeInterval.h | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/sycomore/TimeInterval.cpp b/src/sycomore/TimeInterval.cpp index 78f46b0..84721f0 100644 --- a/src/sycomore/TimeInterval.cpp +++ b/src/sycomore/TimeInterval.cpp @@ -36,6 +36,12 @@ ::shortest(Vector3Q const & k, Quantity const & G_max) return sycomore::TimeInterval(min_time, k); } +TimeInterval +::TimeInterval() +{ + // Nothing else. +} + TimeInterval ::TimeInterval( Quantity const & duration, Quantity const & gradient) diff --git a/src/sycomore/TimeInterval.h b/src/sycomore/TimeInterval.h index edfded7..938ffb1 100644 --- a/src/sycomore/TimeInterval.h +++ b/src/sycomore/TimeInterval.h @@ -25,13 +25,16 @@ class TimeInterval * or dephasing (rad/m) and maximum gradient amplitude */ static TimeInterval shortest(Vector3Q const & k, Quantity const & G_max); - + + /// @brief Default-initialize duration and gradient. + TimeInterval(); + /** * @brief Constructor, gradient may be specified as amplitude (in T/m), * area (in T/m*s) or dephasing (in rad/m). */ TimeInterval( - Quantity const & duration=0*units::s, + Quantity const & duration, Quantity const & gradient=0*units::T/units::m); /** @@ -39,7 +42,13 @@ class TimeInterval * area (in T/m*s) or dephasing (in rad/m). */ TimeInterval(Quantity const & duration, Vector3Q const & gradient); - + + TimeInterval(TimeInterval const &) = default; + TimeInterval(TimeInterval &&) = default; + TimeInterval & operator=(TimeInterval const &) = default; + TimeInterval & operator=(TimeInterval &&) = default; + ~TimeInterval() = default; + /// @brief Return the duration. Quantity const & duration() const;