Skip to content

Commit

Permalink
Address Doxygen warnings (#358)
Browse files Browse the repository at this point in the history
* Address containers archtype doxygen warnings

* Further associative container comments

* More doxygen warning fixes

* Further comments

* Remove failed doxygen context defines
  • Loading branch information
Twon authored Feb 17, 2025
1 parent a78f740 commit 78366ef
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 8 deletions.
2 changes: 2 additions & 0 deletions libraries/application/src/morpheus/application/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <morpheus/core/conformance/format.hpp>

#include <cstdint>

namespace morpheus::application
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BinaryReader
/// \copydoc morpheus::serialisation::concepts::ReaderArchtype::endComposite()
void endComposite() noexcept {}

/// \copydoc morpheus::serialisation::concepts::ReaderArchtype::beginValue()
/// \copydoc morpheus::serialisation::concepts::ReaderArchtype::beginValue(std::string_view const)
void beginValue(std::string_view const) noexcept {}

/// \copydoc morpheus::serialisation::concepts::ReaderArchtype::endValue()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class BinaryWriter
/// \copydoc morpheus::serialisation::concepts::WriterArchtype::endComposite()
void endComposite() noexcept {}

/// \copydoc morpheus::serialisation::concepts::WriterArchtype::beginValue()
/// \copydoc morpheus::serialisation::concepts::WriterArchtype::beginValue(std::string_view const)
void beginValue(std::string_view const) noexcept {}

/// \copydoc morpheus::serialisation::concepts::WriterArchtype::endValue()
Expand All @@ -56,7 +56,7 @@ class BinaryWriter
/// \copydoc morpheus::serialisation::concepts::WriterArchtype::endSequence()
void endSequence() noexcept {}

/// \copydoc morpheus::serialisation::concepts::WriterArchtype::beginNullable()
/// \copydoc morpheus::serialisation::concepts::WriterArchtype::beginNullable(bool const)
void beginNullable(bool const null)
{
write(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ class MORPHEUSCORE_EXPORT JsonWriter
/// \copydoc morpheus::serialisation::concepts::WriterArchtype::endComposite()
void endComposite();

/// \copydoc morpheus::serialisation::concepts::WriterArchtype::beginValue()
/// \copydoc morpheus::serialisation::concepts::WriterArchtype::beginValue(std::string_view const)
void beginValue(std::string_view const key);

/// \copydoc morpheus::serialisation::concepts::WriterArchtype::endValue()
void endValue();

/// \copydoc morpheus::serialisation::concepts::WriterArchtype::beginSequence()
/// \copydoc morpheus::serialisation::concepts::WriterArchtype::beginSequence(std::optional<std::size_t>)
void beginSequence(std::optional<std::size_t> size = std::nullopt);

/// \copydoc morpheus::serialisation::concepts::WriterArchtype::endSequence()
void endSequence();

/// \copydoc morpheus::serialisation::concepts::WriterArchtype::beginNullable()
/// \copydoc morpheus::serialisation::concepts::WriterArchtype::beginNullable(bool const)
void beginNullable(bool const null);

/// \copydoc morpheus::serialisation::concepts::WriterArchtype::endNullable()
Expand Down
4 changes: 4 additions & 0 deletions libraries/core/src/morpheus/core/serialisation/serialise.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ auto deserialise(Serialiser& serialiser)

}

/// \struct serialise_fn
/// Customisation point functor for serialising a value.
struct serialise_fn {
template<concepts::WriteSerialiser Serialiser, typename Type>
void operator() (Serialiser& serialiser, Type const& value) const
Expand All @@ -40,6 +42,8 @@ struct serialise_fn {
}
};

/// \struct deserialise_fn
/// Customisation point functor for deserialising a value.
struct deserialise_fn {
template<concepts::ReadSerialiser Serialiser, typename Type>
auto operator() (Serialiser& serialiser) const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,34 @@ namespace morpheus::containers::concepts::archetypes

struct AllocatorAware : public Container
{
/// The allocator type of the container.
using allocator_type = std::allocator<int>;

/// Default constructor
constexpr AllocatorAware();
/// Construct the container with a specific allocator.
constexpr AllocatorAware(allocator_type const&);
/// Copy constructor
constexpr AllocatorAware(AllocatorAware const&);
/// Copy constructor with a specific allocator.
constexpr AllocatorAware(AllocatorAware const&, allocator_type const&);
/// Move constructor
constexpr AllocatorAware(AllocatorAware&&);
/// Move constructor with a specific allocator.
constexpr AllocatorAware(AllocatorAware&&, allocator_type const&);

/// Copy assignment operator
constexpr AllocatorAware& operator=(AllocatorAware const&);
/// Move assignment operator
constexpr AllocatorAware& operator=(AllocatorAware&&);

/// Spaceship operator
constexpr auto operator<=>(AllocatorAware const&) const = default;

/// Get the allocator of the container.
constexpr allocator_type get_allocator() const noexcept;

/// Swap the contents of two containers.
constexpr void swap(AllocatorAware&) noexcept;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,30 @@ struct Multi<true>
template<bool M = false>
struct Mapped
{
/// The value type of the container.
using value_type = int;
/// The key type of the container.
using key_type = value_type;
/// The allocator type of the container.
using allocator_type = std::allocator<value_type>;

/// Spaceship operator
constexpr auto operator<=>(Mapped const&) const = default;
};

template<>
struct Mapped<true>
{
/// The mapped type of the container.
using mapped_type = int;
/// The value type of the container.
using value_type = std::pair<const int, mapped_type>;
/// The key type of the container.
using key_type = typename value_type::first_type;
/// The allocator type of the container.
using allocator_type = std::allocator<value_type>;

/// Spaceship operator
constexpr auto operator<=>(Mapped const&) const = default;
};

Expand All @@ -54,10 +64,15 @@ struct Mapped<true>
template<bool multi = false, bool mapped = false>
struct Associative : AllocatorAware, detail::Multi<multi>, detail::Mapped<mapped>
{
/// The value type of the container.
using value_type = typename detail::Mapped<mapped>::value_type;
/// The key type of the container.
using key_type = typename detail::Mapped<mapped>::key_type;
/// The allocator type of the container.
using allocator_type = typename detail::Mapped<mapped>::allocator_type;
/// The key comparison type of the container.
using key_compare = std::less<int>;
/// The value comparison type of the container.
using value_compare = key_compare;
struct node_type{};

Expand All @@ -79,25 +94,41 @@ struct Associative : AllocatorAware, detail::Multi<multi>, detail::Mapped<mapped
using AllocatorAware::AllocatorAware;
using detail::Mapped<mapped>::Mapped;

/// Default constructor.
constexpr Associative();
/// Construct the container with a specific key comparison function.
constexpr Associative(key_compare const&);
/// Construct the container from a begin and end iterator with a specific key comparison function.
constexpr Associative(iterator, iterator, key_compare const&);
/// Construct the container from a begin and end iterator.
constexpr Associative(iterator, iterator);
#if (__cpp_lib_containers_ranges >= 202202L)
/// Construct the container from a range and key comparison function.
constexpr Associative(std::from_range_t, ranges::range auto, key_compare const&);
/// Construct the container from a range.
constexpr Associative(std::from_range_t, ranges::range auto);
#endif // (__cpp_lib_containers_ranges >= 202202L)
/// Construct the container from an initializer list and key comparison function.
constexpr Associative(std::initializer_list<value_type>, key_compare const&);
/// Construct the container from an initializer list.
constexpr Associative(std::initializer_list<value_type>);
/// Copy constructor.
constexpr Associative(Associative const&);
/// Move constructor.
constexpr Associative(Associative&&);
/// Copy assignment operator.
constexpr Associative& operator=(Associative const&);
/// Move assignment operator.
constexpr Associative& operator=(Associative&&);
/// Assignment operator for initializer list.
constexpr Associative& operator=(std::initializer_list<value_type>);

/// Get the allocator of the container.
constexpr allocator_type get_allocator() const noexcept;

/// Get the key comparison function of the container.
constexpr key_compare key_comp() const;
/// Get the value comparison function of the container.
constexpr value_compare value_comp() const;

constexpr InsertReturnType emplace(auto... args);
Expand Down Expand Up @@ -140,9 +171,8 @@ struct Associative : AllocatorAware, detail::Multi<multi>, detail::Mapped<mapped
BoundReturnType upper_bound(key_type const&);
BoundConstReturnType upper_bound(key_type const&) const;

/// Spaceship operator
constexpr auto operator<=>(Associative const&) const = default;


};

} // namespace morpheus::containers::concepts::archetypes
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,53 @@ using std::empty;

struct Container
{
/// The value type of the container.
using value_type = int;
/// The reference type of the container.
using reference = value_type&;
/// The const reference type of the container.
using const_reference = value_type const&;
/// The iterator type of the container.
using iterator = int*;
/// The const iterator type of the container.
using const_iterator = int const *;
/// The difference type of the container.
using difference_type = std::ptrdiff_t;
/// The size type of the container.
using size_type = std::size_t;

/// Default constructor
constexpr Container();
/// Copy constructor
constexpr Container(Container const&);
/// Move constructor
constexpr Container(Container&&);
/// Destructor
constexpr ~Container() = default;
/// Copy assignment operator
constexpr Container& operator=(Container const&);
/// Move assignment operator
constexpr Container& operator=(Container&&);

constexpr auto operator<=>(Container const&) const = default;

/// returns an iterator to the beginning
constexpr iterator begin() noexcept;
/// returns an iterator to the end
constexpr iterator end() noexcept;
/// returns a const iterator to the beginning
constexpr const_iterator begin() const noexcept;
/// returns a const iterator to the end
constexpr const_iterator end() const noexcept;
/// returns a const iterator to the beginning
constexpr const_iterator cbegin() const noexcept;
/// returns a const iterator to the end
constexpr const_iterator cend() const noexcept;
/// returns the number of elements
constexpr size_type size() const noexcept;
/// returns the maximum number of elements
constexpr size_type max_size() const noexcept;
/// returns whether the container is empty
constexpr bool empty() const noexcept;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@ using std::crend;

struct Reversible : Container
{
/// The reverse iterator type of the container.
using reverse_iterator = std::reverse_iterator<iterator>;
/// The const reverse iterator type of the container.
using const_reverse_iterator = std::reverse_iterator<const_iterator>;

/// returns an reverse iterator to the beginning
constexpr reverse_iterator rbegin() noexcept;
/// returns an reverse iterator to the end
constexpr reverse_iterator rend() noexcept;
/// returns a const reverse iterator to the beginning
constexpr const_reverse_iterator rbegin() const noexcept;
/// returns a const reverse iterator to the end
constexpr const_reverse_iterator rend() const noexcept;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ struct Multi<true>
template<bool M = false>
struct Mapped
{
/// The value type of the container.
using value_type = int;
/// The key type of the container.
using key_type = value_type;
/// The allocator type of the container.
using allocator_type = std::allocator<value_type>;

constexpr auto operator<=>(Mapped const&) const = default;
Expand All @@ -41,9 +44,13 @@ struct Mapped
template<>
struct Mapped<true>
{
/// The mapped type of the container.
using mapped_type = int;
/// The value type of the container.
using value_type = std::pair<const int, mapped_type>;
/// The key type of the container.
using key_type = typename value_type::first_type;
/// The allocator type of the container.
using allocator_type = std::allocator<value_type>;
constexpr auto operator<=>(Mapped const&) const = default;
};
Expand All @@ -53,8 +60,11 @@ struct Mapped<true>
template<bool multi = false, bool mapped = false>
struct Unordered : public AllocatorAware, detail::Multi<multi>, detail::Mapped<mapped>
{
/// The value type of the container.
using value_type = typename detail::Mapped<mapped>::value_type;
/// The key type of the container.
using key_type = typename detail::Mapped<mapped>::key_type;
/// The allocator type of the container.
using allocator_type = typename detail::Mapped<mapped>::allocator_type;
using hasher = std::hash<int>;
using key_equal = std::equal_to<int>;
Expand Down

0 comments on commit 78366ef

Please sign in to comment.