File tree Expand file tree Collapse file tree 4 files changed +17
-0
lines changed
Expand file tree Collapse file tree 4 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -440,12 +440,15 @@ OPENPMD_protected
440440
441441 inline Data_t const &get () const
442442 {
443+ // cannot call this in the const overload
444+ // datasetDefined(*m_recordComponentData);
443445 return dynamic_cast <Data_t const &>(*m_attri);
444446 }
445447
446448 inline Data_t &get ()
447449 {
448450 auto &res = dynamic_cast <Data_t &>(*m_attri);
451+ datasetDefined (res);
449452 return res;
450453 }
451454
Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ namespace internal
4747 * instead defined via light-weight attributes.
4848 */
4949 bool m_isConstant = false ;
50+ /*
51+ * ... document this ...
52+ */
53+ bool m_datasetDefined = false ;
5054
5155 BaseRecordComponentData (BaseRecordComponentData const &) = delete ;
5256 BaseRecordComponentData (BaseRecordComponentData &&) = delete ;
@@ -112,6 +116,8 @@ class BaseRecordComponent : virtual public Attributable
112116 return dynamic_cast <Data_t &>(*m_attri);
113117 }
114118
119+ void datasetDefined (Data_t &);
120+
115121 BaseRecordComponent ();
116122}; // BaseRecordComponent
117123
Original file line number Diff line number Diff line change @@ -121,12 +121,15 @@ OPENPMD_protected
121121
122122 inline Data_t const &get () const
123123 {
124+ // cannot call this in the const overload
125+ // datasetDefined(*m_recordComponentData);
124126 return dynamic_cast <Data_t const &>(*m_attri);
125127 }
126128
127129 inline Data_t &get ()
128130 {
129131 auto &res = dynamic_cast <Data_t &>(*m_attri);
132+ datasetDefined (res);
130133 return res;
131134 }
132135}; // PatchRecordComponent
Original file line number Diff line number Diff line change @@ -71,4 +71,9 @@ BaseRecordComponent::BaseRecordComponent()
7171 std::make_shared<internal::BaseRecordComponentData>());
7272}
7373
74+ void BaseRecordComponent::datasetDefined (
75+ internal::BaseRecordComponentData &data)
76+ {
77+ data.m_datasetDefined = true ;
78+ }
7479} // namespace openPMD
You can’t perform that action at this time.
0 commit comments