Skip to content

Commit 8d58b11

Browse files
AI Agentfranzpoeschel
authored andcommitted
Add Doxygen documentation to new functions and types
1 parent bc3809e commit 8d58b11

14 files changed

Lines changed: 299 additions & 11 deletions

include/openPMD/Dataset.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ namespace openPMD
3434
using Extent = std::vector<std::uint64_t>;
3535
using Offset = std::vector<std::uint64_t>;
3636

37+
/** Selection of a region of memory for storing chunks.
38+
*
39+
* Used to specify a non-contiguous memory region when storing
40+
* data chunks. This allows writing data that is not contiguous
41+
* in memory.
42+
*/
3743
struct MemorySelection
3844
{
3945
Offset offset;

include/openPMD/Datatype.hpp

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,11 @@ inline size_t toBits(Datatype d)
420420
return toBytes(d) * CHAR_BIT;
421421
}
422422

423+
/** Check if a Datatype is a signed type
424+
*
425+
* @param d Datatype to test
426+
* @return true if signed type (integer, floating point, complex), else false
427+
*/
423428
constexpr bool isSigned(Datatype d);
424429

425430
/** Compare if a Datatype is a vector type
@@ -602,6 +607,13 @@ inline bool isSameFloatingPoint(Datatype d)
602607
return isSameFloatingPoint(d, determineDatatype<T_FP>());
603608
}
604609

610+
/** Compare if two Datatypes are equivalent floating point types
611+
*
612+
* @param d1 First Datatype to compare
613+
* @param d2 Second Datatype to compare
614+
* @return true if both types are floating point and have same bitness, else
615+
* false
616+
*/
605617
inline bool isSameFloatingPoint(Datatype d1, Datatype d2)
606618
{
607619
// template
@@ -629,6 +641,13 @@ inline bool isSameComplexFloatingPoint(Datatype d)
629641
return isSameComplexFloatingPoint(d, determineDatatype<T_CFP>());
630642
}
631643

644+
/** Compare if two Datatypes are equivalent complex floating point types
645+
*
646+
* @param d1 First Datatype to compare
647+
* @param d2 Second Datatype to compare
648+
* @return true if both types are complex floating point and have same bitness,
649+
* else false
650+
*/
632651
inline bool isSameComplexFloatingPoint(Datatype d1, Datatype d2)
633652
{
634653
// template
@@ -656,6 +675,13 @@ inline bool isSameInteger(Datatype d)
656675
return isSameInteger(d, determineDatatype<T_Int>());
657676
}
658677

678+
/** Compare if two Datatypes are equivalent integer types
679+
*
680+
* @param d1 First Datatype to compare
681+
* @param d2 Second Datatype to compare
682+
* @return true if both types are integers, same signedness and same bitness,
683+
* else false
684+
*/
659685
inline bool isSameInteger(Datatype d1, Datatype d2)
660686
{
661687
// template
@@ -708,13 +734,24 @@ constexpr bool isChar(Datatype d)
708734
template <typename T_Char>
709735
constexpr bool isSameChar(Datatype d);
710736

737+
/** Compare if two Datatypes are equivalent char types
738+
*
739+
* @param d1 First Datatype to compare
740+
* @param d2 Second Datatype to compare
741+
* @return true if both types are chars with same signedness and size, else
742+
* false
743+
*/
711744
constexpr bool isSameChar(Datatype d1, Datatype d2);
712745

713746
/** Comparison for two Datatypes
714747
*
715748
* Besides returning true for the same types, identical implementations on
716749
* some platforms, e.g. if long and long long are the same or double and
717750
* long double will also return true.
751+
*
752+
* @param d First Datatype to compare
753+
* @param e Second Datatype to compare
754+
* @return true if the datatypes are equivalent
718755
*/
719756
constexpr bool isSame(openPMD::Datatype d, openPMD::Datatype e);
720757

@@ -726,14 +763,33 @@ constexpr bool isSame(openPMD::Datatype d, openPMD::Datatype e);
726763
*/
727764
Datatype basicDatatype(Datatype dt);
728765

766+
/** Convert a scalar Datatype to its vector variant
767+
*
768+
* @param dt Scalar Datatype to convert
769+
* @return Vector Datatype (e.g., INT becomes VEC_INT)
770+
*/
729771
Datatype toVectorType(Datatype dt);
730772

773+
/** Convert a Datatype to its string representation
774+
*
775+
* @param dt Datatype to convert
776+
* @return String representation of the Datatype
777+
*/
731778
std::string datatypeToString(Datatype dt);
732779

780+
/** Convert a string to a Datatype
781+
*
782+
* @param s String representation of a Datatype
783+
* @return The corresponding Datatype
784+
*/
733785
Datatype stringToDatatype(const std::string &s);
734786

735-
void warnWrongDtype(std::string const &key, Datatype store, Datatype request);
736-
787+
/** Stream operator for Datatype
788+
*
789+
* @param os Output stream
790+
* @param dt Datatype to output
791+
* @return Reference to the stream
792+
*/
737793
std::ostream &operator<<(std::ostream &, openPMD::Datatype const &);
738794

739795
template <typename T>

include/openPMD/IO/ADIOS/ADIOS2File.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,13 @@ struct WriteDataset
108108
static void call(Params &&...);
109109
};
110110

111+
/** Buffered put operation with unique pointer */
111112
struct BufferedUniquePtrPut
112113
{
113114
std::string name;
114115
Offset offset;
115116
Extent extent;
117+
/** Optional memory selection for non-contiguous memory regions */
116118
std::optional<MemorySelection> memorySelection;
117119
UniquePtrWithLambda<void> data;
118120
Datatype dtype = Datatype::UNDEFINED;

include/openPMD/IO/ADIOS/macros.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ namespace openPMD
4545
{
4646
namespace detail
4747
{
48+
/** Trait to check if a variable supports SetMemorySelection
49+
*
50+
* @tparam Variable ADIOS2 variable type
51+
*/
4852
template <typename Variable, typename SFINAE = void>
4953
struct CanTheMemorySelectionBeReset
5054
{
@@ -60,6 +64,7 @@ namespace detail
6064
};
6165
} // namespace detail
6266

67+
/** Whether ADIOS2 Variable supports SetMemorySelection */
6368
constexpr bool CanTheMemorySelectionBeReset =
6469
detail::CanTheMemorySelectionBeReset<adios2::Variable<int>>::value;
6570
} // namespace openPMD

include/openPMD/IO/AbstractIOHandler.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ class AbstractIOHandler
265265
* backends that decide to implement this operation asynchronously.
266266
*/
267267
std::future<void> flush(internal::FlushParams const &);
268+
/** Counter tracking the number of flush operations. This is later used to
269+
* avoid repeated flushing in the DeferredComputation objects returned by
270+
* the loadStoreChunk() API. (The counter is copied as a weak reference to
271+
* the shared pointer, and the value is compared to the value upon enqueuing
272+
* the operation. If the flush counter has proceeded past the old value, our
273+
* operation has already been run.) */
268274
std::shared_ptr<unsigned long long> m_flushCounter =
269275
std::make_shared<unsigned long long>(0);
270276

@@ -319,6 +325,13 @@ class AbstractIOHandler
319325
bool m_verify_homogeneous_extents = true;
320326

321327
protected:
328+
/** Implementation of flush operation for subclasses
329+
*
330+
* Do not call directly, use flush() wrapper instead.
331+
*
332+
* @param params Parsed flush parameters
333+
* @return Future indicating completion state
334+
*/
322335
virtual std::future<void> flush_impl(internal::ParsedFlushParams &) = 0;
323336
}; // AbstractIOHandler
324337

include/openPMD/IO/IOTask.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ struct OPENPMDAPI_EXPORT
495495

496496
Extent extent = {};
497497
Offset offset = {};
498+
/** Optional memory selection for non-contiguous memory regions */
498499
std::optional<MemorySelection> memorySelection = std::nullopt;
499500
Datatype dtype = Datatype::UNDEFINED;
500501
auxiliary::WriteBuffer data;
@@ -559,7 +560,8 @@ struct OPENPMDAPI_EXPORT
559560
}
560561

561562
// in parameters
562-
bool queryOnly = false; // query if the backend supports this
563+
/** If true, only query if the backend supports buffer views without performing operation */
564+
bool queryOnly = false;
563565
Offset offset;
564566
Extent extent;
565567
Datatype dtype = Datatype::UNDEFINED;

include/openPMD/IO/InvalidatableFile.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ struct hash<openPMD::InvalidatableFile>
8383
result_type operator()(argument_type const &s) const noexcept;
8484
};
8585

86+
/** Specialization of std::less for InvalidatableFile
87+
*
88+
* Enables using InvalidatableFile in ordered containers like std::set
89+
* for consistent ordering across parallel processes.
90+
*/
8691
template <>
8792
struct less<openPMD::InvalidatableFile>
8893
{

include/openPMD/Iteration.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,12 @@ class Iteration : public Attributable
454454

455455
namespace traits
456456
{
457+
/** Generation policy for Iteration objects.
458+
*
459+
* This policy populates the cached iteration index when an Iteration
460+
* is created or inserted into a Series, enabling constant-time lookup
461+
* of the owning map entry.
462+
*/
457463
template <>
458464
struct GenerationPolicy<Iteration>
459465
{

0 commit comments

Comments
 (0)