Skip to content

Commit 93f1ec2

Browse files
committed
wip: ScientificDefaults without CRT
1 parent f04a7d9 commit 93f1ec2

19 files changed

Lines changed: 23 additions & 53 deletions

include/openPMD/Iteration.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ namespace internal
145145
*/
146146
class Iteration
147147
: public Attributable
148-
, internal::ScientificDefaults<Iteration>
148+
, internal::ScientificDefaults
149149
{
150150
template <typename T, typename T_key, typename T_container>
151151
friend class Container;
@@ -156,7 +156,7 @@ class Iteration
156156
friend class Writable;
157157
friend class StatefulIterator;
158158
friend class StatefulSnapshotsContainer;
159-
friend class internal::ScientificDefaults<Iteration>;
159+
friend class internal::ScientificDefaults;
160160

161161
public:
162162
Iteration(Iteration const &) = default;

include/openPMD/Mesh.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,10 @@ namespace openPMD
3939
* @see
4040
* https://github.com/openPMD/openPMD-standard/blob/latest/STANDARD.md#mesh-based-records
4141
*/
42-
class Mesh
43-
: public BaseRecord<MeshRecordComponent>
44-
, internal::ScientificDefaults<Mesh>
42+
class Mesh : public BaseRecord<MeshRecordComponent>
4543
{
4644
friend class Container<Mesh>;
4745
friend class Iteration;
48-
template <typename>
4946
friend class internal::ScientificDefaults;
5047

5148
public:

include/openPMD/ParticleSpecies.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,13 @@ namespace openPMD
3333

3434
class ParticleSpecies
3535
: public Container<Record>
36-
, internal::ScientificDefaults<ParticleSpecies>
36+
, internal::ScientificDefaults
3737
{
3838
friend class Container<ParticleSpecies>;
3939
friend class Container<Record>;
4040
friend class Iteration;
4141
template <typename T>
4242
friend T &internal::makeOwning(T &self, Series);
43-
template <typename>
4443
friend class internal::ScientificDefaults;
4544

4645
public:

include/openPMD/Record.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,11 @@
3030

3131
namespace openPMD
3232
{
33-
class Record
34-
: public BaseRecord<RecordComponent>
35-
, internal::ScientificDefaults<Record>
33+
class Record : public BaseRecord<RecordComponent>
3634
{
3735
friend class Container<Record>;
3836
friend class Iteration;
3937
friend class ParticleSpecies;
40-
template <typename>
4138
friend class internal::ScientificDefaults;
4239

4340
public:

include/openPMD/RecordComponent.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class BaseRecord;
113113

114114
class RecordComponent
115115
: public BaseRecordComponent
116-
, internal::ScientificDefaults<RecordComponent>
116+
, protected internal::ScientificDefaults
117117
{
118118
template <typename T, typename T_key, typename T_container>
119119
friend class Container;
@@ -131,7 +131,6 @@ class RecordComponent
131131
friend class MeshRecordComponent;
132132
template <typename T>
133133
friend T &internal::makeOwning(T &self, Series);
134-
template <typename>
135134
friend class internal::ScientificDefaults;
136135

137136
public:

include/openPMD/backend/BaseRecord.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ template <typename T_elem>
180180
class BaseRecord
181181
: public Container<T_elem>
182182
, public T_elem // T_RecordComponent
183-
, internal::ScientificDefaults<BaseRecord<T_elem>>
183+
// ScientificDefaults already inherited via Container
184+
// , internal::ScientificDefaults
184185
{
185186
public:
186187
using T_RecordComponent = T_elem;
@@ -199,7 +200,6 @@ class BaseRecord
199200
friend class internal::ScalarIterator;
200201
template <typename T>
201202
friend T &internal::makeOwning(T &self, Series);
202-
template <typename>
203203
friend class internal::ScientificDefaults;
204204

205205
using Data_t =

include/openPMD/backend/MeshRecordComponent.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,14 @@ namespace internal
3333
class BaseRecordData;
3434
}
3535

36-
class MeshRecordComponent
37-
: public RecordComponent
38-
, internal::ScientificDefaults<MeshRecordComponent>
36+
class MeshRecordComponent : public RecordComponent
3937
{
4038
template <typename T, typename T_key, typename T_container>
4139
friend class Container;
4240
template <typename>
4341
friend class BaseRecord;
4442
template <typename, typename>
4543
friend class internal::BaseRecordData;
46-
template <typename>
4744
friend class internal::ScientificDefaults;
4845

4946
friend class Mesh;

include/openPMD/backend/PatchRecord.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,11 @@
2828

2929
namespace openPMD
3030
{
31-
class PatchRecord
32-
: public BaseRecord<PatchRecordComponent>
33-
, internal::ScientificDefaults<PatchRecord>
31+
class PatchRecord : public BaseRecord<PatchRecordComponent>
3432
{
3533
friend class Container<PatchRecord>;
3634
friend class ParticleSpecies;
3735
friend class ParticlePatches;
38-
template <typename>
3936
friend class internal::ScientificDefaults;
4037

4138
public:

include/openPMD/backend/PatchRecordComponent.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ namespace openPMD
4343
/**
4444
* @todo add support for constant patch record components
4545
*/
46-
class PatchRecordComponent
47-
: public RecordComponent
48-
, internal::ScientificDefaults<PatchRecordComponent>
46+
class PatchRecordComponent : public RecordComponent
4947
{
5048
template <typename T, typename T_key, typename T_container>
5149
friend class Container;
@@ -56,7 +54,6 @@ class PatchRecordComponent
5654
friend class ParticlePatches;
5755
friend class PatchRecord;
5856
friend class ParticleSpecies;
59-
template <typename>
6057
friend class internal::ScientificDefaults;
6158

6259
public:

include/openPMD/backend/ScientificDefaults.hpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,16 @@ struct ConfigAttribute;
1414
* It implements (most of) the attribute definitions from
1515
* github.com/openPMD/openPMD-standard/blob/latest/STANDARD.md
1616
*/
17-
template <typename Child> // CRT
1817
class ScientificDefaults
1918
{
2019
private:
21-
auto asChild() -> Child &;
22-
auto asChild() const -> Child const &;
23-
24-
template <typename F>
25-
using setter_t = Child &(Child::*)();
26-
2720
[[nodiscard]] auto defaultAttribute(char const *attrName)
2821
-> ConfigAttribute;
2922

3023
template <typename Parent, bool write>
3124
void addParentDefaults(OpenpmdStandard);
3225

33-
template <bool write>
34-
void defaults_impl(OpenpmdStandard);
26+
virtual void defaults_impl(bool write, OpenpmdStandard);
3527

3628
protected:
3729
// Called upon Iteration::close(), will fill in defaults below Iteration
@@ -50,5 +42,5 @@ class ScientificDefaults
5042

5143
template <typename Child>
5244
constexpr bool HasScientificDefaults_v =
53-
std::is_base_of_v<ScientificDefaults<Child>, Child>;
45+
std::is_base_of_v<ScientificDefaults, Child>;
5446
} // namespace openPMD::internal

0 commit comments

Comments
 (0)