diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-24 11:32:00 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-27 16:42:58 +0200 |
commit | 68790fd7b8c24cf8a7e9132211338d76d2238af5 (patch) | |
tree | 9336d950f852fd2fec416cd64810b0151635f580 /spline/spline.hpp | |
parent | b15fe980671e028d0849e11878e0edf9a88669a5 (diff) |
spline: use default initialization
Diffstat (limited to 'spline/spline.hpp')
-rw-r--r-- | spline/spline.hpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/spline/spline.hpp b/spline/spline.hpp index defa80fc..54c53767 100644 --- a/spline/spline.hpp +++ b/spline/spline.hpp @@ -43,7 +43,7 @@ signals: void recomputed() const; }; -} +} // ns spline_detail class OTR_SPLINE_EXPORT spline final { @@ -60,23 +60,20 @@ class OTR_SPLINE_EXPORT spline final std::shared_ptr<spline_detail::settings> s; QMetaObject::Connection connection, conn_maxx, conn_maxy; - std::vector<float> data; - using interp_data_t = decltype(data); + static constexpr std::size_t value_count = 4096; - static constexpr int value_count = 4096; + std::vector<float> data = std::vector<float>(value_count, float(-16)); - MyMutex _mutex; + mutex _mutex { mutex::recursive }; QPointF last_input_value; - std::shared_ptr<QObject> ctx; + std::shared_ptr<QObject> ctx { std::make_shared<QObject>() }; - Axis axis; + Axis axis = NonAxis; - bool activep; - bool validp; + bool activep = false; + bool validp = false; public: - using settings = spline_detail::settings; - void invalidate_settings(); void reload(); @@ -108,9 +105,11 @@ public: bundle get_bundle(); void ensure_valid(QList<QPointF>& the_points); - std::shared_ptr<settings> get_settings(); - std::shared_ptr<const settings> get_settings() const; + std::shared_ptr<spline_detail::settings> get_settings(); + std::shared_ptr<const spline_detail::settings> get_settings() const; using points_t = decltype(s->points()); int get_point_count() const; + + using settings = spline_detail::settings; }; |