File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -366,9 +366,6 @@ class BaseRecord
366366 */
367367 bool scalar () const ;
368368
369- protected:
370- void readBase ();
371-
372369private:
373370 void flush (std::string const &, internal::FlushParams const &) final ;
374371 virtual void
Original file line number Diff line number Diff line change @@ -239,8 +239,8 @@ struct ConfigAttribute
239239 Attribute attribute (Attribute::from_any, std::move (*aRead.m_resource ));
240240 if (attributeReaders.empty ())
241241 {
242- std::cout << " Empty attribute readers for " << this -> attrName
243- << std::endl ;
242+ // No readers emplaced for this attribute
243+ return ;
244244 }
245245 for (auto &attributeReader : attributeReaders)
246246 {
Original file line number Diff line number Diff line change @@ -489,7 +489,7 @@ void Mesh::read()
489489
490490 std::move (homogenizeExtents).homogenize (*this );
491491
492- readBase ( );
492+ internal::ScientificDefaults<Mesh>:: readDefaults ( IOHandler ()-> m_standard );
493493
494494 readAttributes (ReadMode::FullyReread);
495495}
Original file line number Diff line number Diff line change 2424#include " openPMD/ThrowError.hpp"
2525#include " openPMD/UnitDimension.hpp"
2626#include " openPMD/backend/BaseRecord.hpp"
27+ #include " openPMD/backend/ScientificDefaults.hpp"
2728
2829#include < iostream>
2930
@@ -191,7 +192,7 @@ auto Record::read() -> internal::HomogenizeExtents
191192 }
192193 }
193194
194- readBase ( );
195+ internal::ScientificDefaults<Record>:: readDefaults ( IOHandler ()-> m_standard );
195196
196197 readAttributes (ReadMode::FullyReread);
197198 return res;
Original file line number Diff line number Diff line change 2929#include " openPMD/auxiliary/StringManip.hpp"
3030#include " openPMD/backend/Attributable.hpp"
3131#include " openPMD/backend/BaseRecord.hpp"
32+ #include " openPMD/backend/ScientificDefaults.hpp"
3233#include " openPMD/backend/Variant_internal.hpp"
3334
3435// comment so clang-format does not move this
@@ -515,6 +516,8 @@ void RecordComponent::flush(
515516void RecordComponent::read ()
516517{
517518 readBase ();
519+ internal::ScientificDefaults<RecordComponent>::readDefaults (
520+ IOHandler ()->m_standard );
518521}
519522
520523namespace
Original file line number Diff line number Diff line change @@ -765,13 +765,6 @@ inline bool BaseRecord<T_elem>::scalar() const
765765 return this ->datasetDefined ();
766766}
767767
768- template <typename T_elem>
769- inline void BaseRecord<T_elem>::readBase ()
770- {
771- internal::ScientificDefaults<BaseRecord<T_elem>>::readDefaults (
772- this ->IOHandler ()->m_standard );
773- }
774-
775768template <typename T_elem>
776769inline void BaseRecord<T_elem>::flush (
777770 std::string const &name, internal::FlushParams const &flushParams)
Original file line number Diff line number Diff line change @@ -492,7 +492,8 @@ void ScientificDefaults<Child>::defaults_impl(OpenpmdStandard standard)
492492 else if constexpr (std::is_same_v<Child, Record>)
493493 {
494494 defaultAttribute (" timeOffset" )
495- .template withSetter <Record>(0 .f , &Record::setTimeOffset)(wor);
495+ .template withSetter <Record>(0 .f , &Record::setTimeOffset)
496+ .withReader (float_types, require_scalar)(wor);
496497
497498 auto const &keyInParent = asChild ().writable ().ownKeyWithinParent ;
498499 if (keyInParent == " position" || keyInParent == " positionOffset" )
You can’t perform that action at this time.
0 commit comments