Skip to content

Commit

Permalink
docs(core): replace by
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Aug 27, 2023
1 parent c2b7c76 commit 58a386d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
8 changes: 4 additions & 4 deletions core/include/cubos/core/data/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T>
inline T& get()
{
Expand All @@ -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 <typename T>
inline bool has() const
{
Expand All @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions core/include/cubos/core/data/deserializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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;
Expand Down
40 changes: 20 additions & 20 deletions core/include/cubos/core/data/package.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -127,23 +127,23 @@ 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
/// the type of the package. If the package isn't a bool, 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(bool data);

/// Packages the specified string into this package, without changing
/// the type of the package. If the package isn't a string already,
/// 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.
Expand All @@ -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 <typename T>
inline bool into(T& data, Context* context = nullptr) const;

Expand All @@ -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 <typename T>
requires std::default_initializable<T>
inline T get(Context* context = nullptr) const
Expand All @@ -177,58 +177,58 @@ 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.
/// For empty packages, or scalars (including strings), this is always
/// 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.
Expand All @@ -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;
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions core/include/cubos/core/data/serialization_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/data/serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 58a386d

Please sign in to comment.