Skip to content

Commit 1d64302

Browse files
committed
Cleanup, documentation
1 parent e5d72ad commit 1d64302

21 files changed

+36
-48
lines changed

include/openPMD/Iteration.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ class Iteration
466466
void runDeferredParseAccess();
467467

468468
protected:
469-
void defaults_impl(bool write, OpenpmdStandard) override;
469+
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
470470
}; // Iteration
471471

472472
namespace traits

include/openPMD/Mesh.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,9 @@ class Mesh : public BaseRecord<MeshRecordComponent>
334334
auto retrieveDimensionality() const -> uint64_t;
335335

336336
protected:
337-
void defaults_impl(bool write, OpenpmdStandard) override;
337+
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
338338
}; // Mesh
339339

340-
static_assert(internal::IsContainer_v<Mesh>);
341-
static_assert(std::is_same_v<
342-
Container<MeshRecordComponent>,
343-
internal::AsContainer_t<Mesh>>);
344-
345340
template <typename T>
346341
inline std::vector<T> Mesh::gridSpacing() const
347342
{

include/openPMD/ParticleSpecies.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class ParticleSpecies
6666
}
6767

6868
protected:
69-
void defaults_impl(bool write, OpenpmdStandard) override;
69+
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
7070
};
7171

7272
namespace traits

include/openPMD/Record.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,9 @@ class Record : public BaseRecord<RecordComponent>
5959
[[nodiscard]] internal::HomogenizeExtents read();
6060

6161
protected:
62-
void defaults_impl(bool write, OpenpmdStandard) override;
62+
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
6363
}; // Record
6464

65-
static_assert(internal::HasScientificDefaults_v<Record>);
66-
6765
template <typename T>
6866
inline T Record::timeOffset() const
6967
{

include/openPMD/RecordComponent.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ OPENPMD_protected
552552
void verifyChunk(Datatype, Offset const &, Extent const &) const;
553553

554554
protected:
555-
void defaults_impl(bool write, OpenpmdStandard) override;
555+
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
556556
}; // RecordComponent
557557

558558
namespace internal

include/openPMD/backend/BaseRecord.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ class BaseRecord
384384
void eraseScalar();
385385

386386
protected:
387-
void defaults_impl(bool write, OpenpmdStandard) override;
387+
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
388388
}; // BaseRecord
389389

390390
namespace detail

include/openPMD/backend/Container.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,5 @@ namespace internal
354354

355355
~EraseStaleEntries();
356356
};
357-
358-
template <typename T>
359-
constexpr bool IsContainer_v = auxiliary::IsTemplateBaseOf_v<Container, T>;
360-
template <typename T>
361-
using AsContainer_t = auxiliary::AsTemplateBase_t<Container, T>;
362-
363-
static_assert(!IsContainer_v<int>);
364-
static_assert(IsContainer_v<Container<Attributable>>);
365357
} // namespace internal
366358
} // namespace openPMD

include/openPMD/backend/MeshRecordComponent.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class MeshRecordComponent : public RecordComponent
101101
}
102102

103103
protected:
104-
void defaults_impl(bool write, OpenpmdStandard) override;
104+
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
105105
};
106106

107107
template <typename T>

include/openPMD/backend/PatchRecordComponent.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ OPENPMD_protected
113113
PatchRecordComponent(NoInit);
114114

115115
protected:
116-
void defaults_impl(bool write, OpenpmdStandard) override;
116+
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
117117
}; // PatchRecordComponent
118118

119119
template <typename T>

include/openPMD/backend/scientific_defaults/ConfigAttribute.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ struct ConfigAttribute
2828
ConfigAttribute &operator=(ConfigAttribute const &) = delete;
2929
ConfigAttribute &operator=(ConfigAttribute &&) = delete;
3030

31+
// Specify a custom function for setting the default attribute,
32+
// instead of just using setAttribute().
3133
template <typename RecordType, typename S = void, typename GetDefaultValue>
3234
[[nodiscard]] auto withSetter(
3335
GetDefaultValue &&getDefaultVal,
@@ -38,10 +40,12 @@ struct ConfigAttribute
3840
auxiliary::CallResult_t<GetDefaultValue>,
3941
S>> setDefaultVal) -> ConfigAttribute &;
4042

43+
// Generically use setAttribute() for initializing
4144
template <typename DefaultValue>
4245
[[nodiscard]] auto withGenericSetter(DefaultValue &&defaultVal)
4346
-> ConfigAttribute &;
4447

48+
// Add readers for attribute parsing
4549
[[nodiscard]] auto withReader(
4650
std::deque<Datatype> eligibleDatatypes,
4751
std::optional<std::shared_ptr<ProcessParsedAttribute>>

0 commit comments

Comments
 (0)