From 80744abcc33bb1cff4abbd12f19d520bd40b1a9e Mon Sep 17 00:00:00 2001 From: karutoh Date: Thu, 1 Feb 2024 20:09:58 -0800 Subject: [PATCH] Documented Array and Vector containers. --- include/ehs/Array.h | 9 +++++++++ include/ehs/DataType.h | 6 +++--- include/ehs/Vector.h | 4 +++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/include/ehs/Array.h b/include/ehs/Array.h index 72f38b4..9ebd3c8 100644 --- a/include/ehs/Array.h +++ b/include/ehs/Array.h @@ -227,6 +227,9 @@ namespace ehs data[b] = std::move(tmp); } + /// Inserts a value at the specified index. + /// @param [in] index The index to insert the value at. + /// @param [in] value The value to add. void Insert(const N index, const T value) { N newSize = 0; @@ -251,6 +254,9 @@ namespace ehs size = newSize; } + /// Removes a value at the specified index. + /// @param [in] index The index to remove a value. + /// @returns The value that was removed. T Remove(const N index) { T popped = {}; @@ -383,6 +389,7 @@ namespace ehs return Pop(); } + /// Releases the resources of the array. void Clear() { if (!data) @@ -418,6 +425,8 @@ namespace ehs return size; } + /// Retrieves the index at the end of the array. + /// @returns The index. N End() const { return size - 1; diff --git a/include/ehs/DataType.h b/include/ehs/DataType.h index 111d45c..6e0bd4e 100644 --- a/include/ehs/DataType.h +++ b/include/ehs/DataType.h @@ -21,9 +21,9 @@ namespace ehs UINT_8 }; - DataType FromAudioBitDepth(const UInt_16 bitDepth); + DataType FromAudioBitDepth(UInt_16 bitDepth); - UInt_8 ToByteDepth(const DataType type); + UInt_8 ToByteDepth(DataType type); - UInt_8 ToBitDepth(const DataType type); + UInt_8 ToBitDepth(DataType type); } \ No newline at end of file diff --git a/include/ehs/Vector.h b/include/ehs/Vector.h index 946bc70..5b09473 100644 --- a/include/ehs/Vector.h +++ b/include/ehs/Vector.h @@ -259,6 +259,8 @@ namespace ehs return stride; } + /// Retrieves the index at the end of the array. + /// @returns The index. N End() const { return size ? size - 1 : size; @@ -617,7 +619,7 @@ namespace ehs } } - /// Clears all values in the vector object. + /// Releases the resources of the vector. void Clear() { if (!size)