Skip to content

Commit

Permalink
refactor(core): remove function pointer docs
Browse files Browse the repository at this point in the history
  • Loading branch information
roby2014 committed Nov 18, 2023
1 parent 1739a02 commit 2850261
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 58 deletions.
14 changes: 0 additions & 14 deletions core/include/cubos/core/reflection/traits/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,24 @@ namespace cubos::core::reflection
class ConstView;

/// @brief Function pointer to get the length of an array instance.
/// @param instance Pointer to the instance.
using Length = std::size_t (*)(const void* instance);

/// @brief Function pointer to get the address of an element in an array instance.
/// @param instance Pointer to the instance.
/// @param index Element index.
using AddressOf = uintptr_t (*)(const void* instance, std::size_t index);

/// @brief Function pointer to insert a default value into the array.
/// @param instance Pointer to the instance.
/// @param index Element index.
using InsertDefault = void (*)(void* instance, std::size_t index);

/// @brief Function pointer to insert a copy of the given value into the array.
/// @param instance Pointer to the instance.
/// @param index Element index.
/// @param value Value.
using InsertCopy = void (*)(void* instance, std::size_t index, const void* value);

/// @brief Function pointer to move the given value into the array.
/// @param instance Pointer to the instance.
/// @param index Element index.
/// @param value Value.
using InsertMove = void (*)(void* instance, std::size_t index, void* value);

/// @brief Function pointer to remove an element of the array.
/// @param instance Pointer to the instance.
/// @param index Element index.
using Erase = void (*)(void* instance, std::size_t index);

/// @brief Constructs.
/// @param elementType Element type of the array.
/// @param length Function used to get the length of an array.
/// @param addressOf Function used to address an element in an array.
ArrayTrait(const Type& elementType, Length length, AddressOf addressOf);
Expand Down
6 changes: 0 additions & 6 deletions core/include/cubos/core/reflection/traits/constructible.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,15 @@ namespace cubos::core::reflection
{
public:
/// @brief Function pointer to the destructor of a type.
/// @param instance Pointer to the instance to destruct.
using Destructor = void (*)(void* instance);

/// @brief Function pointer to the default constructor of a type.
/// @param instance Pointer to the location to construct the instance at.
using DefaultConstructor = void (*)(void* instance);

/// @brief Function pointer to the copy constructor of a type.
/// @param instance Pointer to the location to construct the instance at.
/// @param other Pointer to the instance to copy construct from.
using CopyConstructor = void (*)(void* instance, const void* other);

/// @brief Function pointer to the move constructor of a type.
/// @param instance Pointer to the location to construct the instance at.
/// @param other Pointer to the instance to move construct from.
using MoveConstructor = void (*)(void* instance, void* other);

/// @brief Builder for @ref ConstructibleTrait.
Expand Down
33 changes: 0 additions & 33 deletions core/include/cubos/core/reflection/traits/dictionary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,70 +30,37 @@ namespace cubos::core::reflection
class ConstIterator;

/// @brief Function pointer to get the length of a dictionary instance.
/// @param instance Dictionary instance.
/// @return Length.
using Length = std::size_t (*)(const void* instance);

/// @brief Function pointer to get an iterator to the first key-value pair of a dictionary
/// instance.
/// @note @ref Stop should be called on the returned iterator when it is no longer needed.
/// @param instance Dictionary instance.
/// @param writeable Whether the iterator should provide write access.
/// @return Iterator.
using Begin = void* (*)(uintptr_t instance, bool writeable);

/// @brief Function pointer to get an iterator to a value in an dictionary instance.
/// @note @ref Stop should be called on the returned iterator when it is no longer needed.
/// @param instance Dictionary instance.
/// @param key Key.
/// @param writeable Whether the iterator should provide write access.
/// @return Iterator to the found key-value pair, or null if not found.
using Find = void* (*)(uintptr_t instance, const void* key, bool writeable);

/// @brief Function pointer to advance an iterator.
/// @param instance Dictionary instance.
/// @param iterator Iterator.
/// @param writeable Whether the iterator provides write access.
/// @return Whether the iterator is still valid.
using Advance = bool (*)(uintptr_t instance, void* iterator, bool writeable);

/// @brief Function pointer to destroy an iterator instance.
/// @param iterator Iterator to the key-value pair.
/// @param writeable Whether the iterator provides write access.
using Stop = void (*)(void* iterator, bool writeable);

/// @brief Function pointer to get the address of the key pointed to by an iterator.
/// @param iterator Iterator.
/// @param writeable Whether the iterator provides write access.
/// @return Key address.
using Key = const void* (*)(const void* iterator, bool writeable);

/// @brief Function pointer to get the address of the value pointed to by an iterator.
/// @param iterator Iterator.
/// @param writeable Whether the iterator provides write access.
/// @return Value address.
using Value = uintptr_t (*)(const void* iterator, bool writeable);

/// @brief Function pointer to insert a default value into a dictionary instance.
/// @param instance Dictionary instance.
/// @param key Key.
using InsertDefault = void (*)(void* instance, const void* key);

/// @brief Function pointer to insert a copy of the given value into a dictionary instance.
/// @param instance Dictionary instance.
/// @param key Key.
/// @param value Value.
using InsertCopy = void (*)(void* instance, const void* key, const void* value);

/// @brief Function pointer to move the given value into a dictionary instance.
/// @param instance Dictionary instance.
/// @param key Key.
/// @param value Value.
using InsertMove = void (*)(void* instance, const void* key, void* value);

/// @brief Function pointer to remove a key-value pair of a dictionary instance.
/// @param instance Dictionary instance.
/// @param iterator Iterator to the key-value pair with write access.
using Erase = void (*)(void* instance, const void* iterator);

/// @brief Constructs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@ namespace cubos::core::reflection
{
public:
/// @brief Function pointer to convert an instance of the type into a string.
/// @param instance Instance.
/// @return String.
using Into = std::string (*)(const void* instance);

/// @brief Function pointer to convert a string into an instance of the type.
/// @param instance Instance.
/// @param string String.
/// @return Whether the string was valid.
using From = bool (*)(void* instance, const std::string& string);

/// @brief Constructs.
Expand Down

0 comments on commit 2850261

Please sign in to comment.