From 58a386d708c11084749e18fc26d7a941246508af Mon Sep 17 00:00:00 2001 From: Ricardo Antunes Date: Fri, 25 Aug 2023 12:40:12 +0100 Subject: [PATCH] docs(core): replace by --- core/include/cubos/core/data/context.hpp | 8 ++-- core/include/cubos/core/data/deserializer.hpp | 6 +-- core/include/cubos/core/data/package.hpp | 40 +++++++++---------- .../cubos/core/data/serialization_map.hpp | 6 +-- core/include/cubos/core/data/serializer.hpp | 2 +- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/core/include/cubos/core/data/context.hpp b/core/include/cubos/core/data/context.hpp index 88fdce4ae..55dda0e85 100644 --- a/core/include/cubos/core/data/context.hpp +++ b/core/include/cubos/core/data/context.hpp @@ -39,7 +39,7 @@ namespace cubos::core::data /// If the type is present multiple times, the topmost one is returned. /// Aborts if the data is not present. /// @tparam T The type of the data. - /// @returns the data associated with the given type. + /// @return the data associated with the given type. template inline T& get() { @@ -48,7 +48,7 @@ namespace cubos::core::data /// Checks if there is data associated with the given type. /// @tparam T The type of the data. - /// @returns True if the data is present, false otherwise. + /// @return True if the data is present, false otherwise. template inline bool has() const { @@ -72,12 +72,12 @@ namespace cubos::core::data /// Aborts if the data is not present. /// @param type The type of the data. - /// @returns A pointer to the data associated with the given type. + /// @return A pointer to the data associated with the given type. void* getAny(std::type_index type) const; /// Tries to get the data associated with the given type. /// @param type The type of the data. - /// @returns A pointer to the data associated with the given type, or nullptr if it's not + /// @return A pointer to the data associated with the given type, or nullptr if it's not /// present. void* tryGetAny(std::type_index type) const; diff --git a/core/include/cubos/core/data/deserializer.hpp b/core/include/cubos/core/data/deserializer.hpp index 99052cccb..427e68022 100644 --- a/core/include/cubos/core/data/deserializer.hpp +++ b/core/include/cubos/core/data/deserializer.hpp @@ -138,7 +138,7 @@ namespace cubos::core::data /// Indicates that an array is currently being deserialized. /// The fail bit is set on failure. - /// @returns The length of the array. + /// @return The length of the array. virtual std::size_t beginArray() = 0; /// Indicates that an array is no longer being deserialized. @@ -147,7 +147,7 @@ namespace cubos::core::data /// Indicates that a dictionary is being deserialized. /// The fail bit is set on failure. - /// @returns The length of the dictionary (always 0 on failure). + /// @return The length of the dictionary (always 0 on failure). virtual std::size_t beginDictionary() = 0; /// Indicates that a dictionary is no longer being deserialized. @@ -160,7 +160,7 @@ namespace cubos::core::data /// Sets the fail bit. void fail(); - /// @returns The context of the serializer. + /// @return The context of the serializer. inline Context& context() { return mContext; diff --git a/core/include/cubos/core/data/package.hpp b/core/include/cubos/core/data/package.hpp index b7f577e25..c63d25110 100644 --- a/core/include/cubos/core/data/package.hpp +++ b/core/include/cubos/core/data/package.hpp @@ -109,7 +109,7 @@ namespace cubos::core::data /// 256 would not. /// @see Package::set /// @param data The data to package. - /// @returns True on success, false on failure. + /// @return True on success, false on failure. bool change(int64_t data); /// Packages the specified uint64_t into this package, without changing @@ -118,7 +118,7 @@ namespace cubos::core::data /// would not. /// @see Package::set /// @param data The data to package. - /// @returns True on success, false on failure. + /// @return True on success, false on failure. bool change(uint64_t data); /// Packages the specified double into this package, without changing @@ -127,7 +127,7 @@ namespace cubos::core::data /// lowered. /// @see Package::set /// @param data The data to package. - /// @returns True on success, false on failure. + /// @return True on success, false on failure. bool change(double data); /// Packages the specified bool into this package, without changing @@ -135,7 +135,7 @@ namespace cubos::core::data /// fail. /// @see Package::set /// @param data The data to package. - /// @returns True on success, false on failure. + /// @return True on success, false on failure. bool change(bool data); /// Packages the specified string into this package, without changing @@ -143,7 +143,7 @@ namespace cubos::core::data /// this will fail. /// @see Package::set /// @param data The data to package. - /// @returns True on success, false on failure. + /// @return True on success, false on failure. bool change(const std::string& data); /// Unpackages the package into data. @@ -153,7 +153,7 @@ namespace cubos::core::data /// @tparam T The type of the data to unpackage. /// @param data The data to write to. /// @param context Optional context to use when unpackaging the data. - /// @returns True if the unpackaging succeeded, false otherwise. + /// @return True if the unpackaging succeeded, false otherwise. template inline bool into(T& data, Context* context = nullptr) const; @@ -163,7 +163,7 @@ namespace cubos::core::data /// you're sure the type is correct. /// @tparam T The type of the data to unpackage. /// @param context Optional context to use when unpackaging the data. - /// @returns The data. + /// @return The data. template requires std::default_initializable inline T get(Context* context = nullptr) const @@ -177,7 +177,7 @@ namespace cubos::core::data return data; } - /// @returns The type of the packaged data. + /// @return The type of the packaged data. Type type() const; /// Gets the size of the package. @@ -185,50 +185,50 @@ namespace cubos::core::data /// 0, or 1, respectively. /// For objects, arrays and dictionaries, this is, respectively, the /// field count, the element count and the key-value pair count. - /// @returns The size of the packaged + /// @return The size of the packaged std::size_t size() const; /// Checks if the package is storing a structured data type (object, array or dictionary). - /// @returns True if the package is storing a structured data type, false otherwise. + /// @return True if the package is storing a structured data type, false otherwise. bool isStructured() const; /// Gets a reference to a field of this package. /// If the package isn't storing an object or if the field doesn't exist, this method will abort. /// @param name The name of the field. - /// @returns A reference to the field. + /// @return A reference to the field. Package& field(const std::string& name); /// Gets all of the fields in this package. /// If the package isn't storing an object, this method will abort. - /// @returns A map associating the field name to the field package. + /// @return A map associating the field name to the field package. Fields& fields(); /// Gets all of the fields in this package. /// If the package isn't storing an object, this method will abort. - /// @returns A map associating the field name to the field package. + /// @return A map associating the field name to the field package. const Fields& fields() const; /// Removes a field from this package. /// If the package isn't storing an object, this method will abort. /// @param name The name of the field. - /// @returns The removed field, or an empty package if the field didn't exist. + /// @return The removed field, or an empty package if the field didn't exist. Package removeField(std::string_view name); /// Gets an element of the array stored in this package. /// If the package isn't an array, this method will abort. /// If the index is out of bounds, this method will abort. /// @param index The index of the element in the array. - /// @returns A reference to the element. + /// @return A reference to the element. Package& element(std::size_t index); /// Gets the array stored in this package. /// If the package isn't an array, this method will abort. - /// @returns A vector of the packaged elements. + /// @return A vector of the packaged elements. Elements& elements(); /// Gets the array stored in this package. /// If the package isn't an array, this method will abort. - /// @returns A vector of the packaged elements. + /// @return A vector of the packaged elements. const Elements& elements() const; /// Gets the dictionary stored in this package. @@ -245,7 +245,7 @@ namespace cubos::core::data /// Converts a package type into its string representation. /// @param type The type to convert. - /// @returns The string representation of the type. + /// @return The string representation of the type. static const char* typeToString(Type type); void serialize(Serializer& ser, const char* name) const; @@ -290,7 +290,7 @@ namespace cubos::core::data friend Package; /// Pops data from the current package. - /// @returns Pointer to the popped data. + /// @return Pointer to the popped data. const Package* pop(); /// Stack used to keep the state of the package. @@ -342,7 +342,7 @@ namespace cubos::core::data /// Pushes data to the current package. /// @param data The data to push. /// @param name The name of the field, if any. - /// @returns Pointer to the pushed data. + /// @return Pointer to the pushed data. Package* push(Package::Data&& data, const char* name); /// Stack used to keep the state of the package. diff --git a/core/include/cubos/core/data/serialization_map.hpp b/core/include/cubos/core/data/serialization_map.hpp index 99f1af729..f771387f0 100644 --- a/core/include/cubos/core/data/serialization_map.hpp +++ b/core/include/cubos/core/data/serialization_map.hpp @@ -74,7 +74,7 @@ namespace cubos::core::data /// Gets the reference of a serialized identifier. /// @param id Serialized identifier to get the reference of. - /// @returns Reference of the serialized identifier. + /// @return Reference of the serialized identifier. inline R getRef(const I& id) const { if (mUsingFunctions) @@ -90,7 +90,7 @@ namespace cubos::core::data /// Gets the serialized identifier of a reference. /// @param reference Reference to get the serialized identifier of. - /// @returns Serialized identifier of the reference. + /// @return Serialized identifier of the reference. inline I getId(const R& reference) const { if (mUsingFunctions) @@ -113,7 +113,7 @@ namespace cubos::core::data } /// Gets the number of mapped references. - /// @returns Number of mapped references. + /// @return Number of mapped references. inline std::size_t size() const { return mRefToId.size(); diff --git a/core/include/cubos/core/data/serializer.hpp b/core/include/cubos/core/data/serializer.hpp index 53a1b54f8..2c63c5fa9 100644 --- a/core/include/cubos/core/data/serializer.hpp +++ b/core/include/cubos/core/data/serializer.hpp @@ -159,7 +159,7 @@ namespace cubos::core::data /// Checks if the serializer has failed. bool failed() const; - /// @returns The context of the serializer. + /// @return The context of the serializer. inline Context& context() { return mContext;