Skip to content

Commit bb70df5

Browse files
committed
vdesc doc + groups refinment
1 parent f763ef3 commit bb70df5

5 files changed

Lines changed: 64 additions & 28 deletions

File tree

docs/groups.dox

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
/// @defgroup gl Graph Library (GL)
1+
/// @defgroup GL Graph Library (GL)
22
/// @brief The main module containing the general-purpose template graph library implementation.
33
///
44
/// This module encapsulates all standard graph representations, traversal algorithms, topology
55
/// generators, and I/O utilities. It is heavily reliant on modern C++ paradigms, leveraging
66
/// templates and concepts to provide a fast, generic, and type-safe graph API.
77

8-
/// @defgroup gl_core Core Graph Components
9-
/// @ingroup gl
8+
/// @defgroup GL-Core Core Graph Components
9+
/// @ingroup GL
1010
/// @brief Fundamental graph data structures, descriptors, and configuration tags.
1111
///
1212
/// This group contains the primary building blocks of the library, including the main `gl::graph` class,
1313
/// graph element descriptors and the structural tags (i.e., directed vs. undirected and backend
1414
/// implementation tags) used to dictate graph behavior and memory layout.
1515

16-
/// @defgroup gl_alg Graph Algorithms
17-
/// @ingroup gl
16+
/// @defgroup GL-Algorithm Graph Algorithms
17+
/// @ingroup GL
1818
/// @brief Common graph algorithms and algorithm-related utility.
1919
///
2020
/// Provides generic, highly customizable implementations of classic graph algorithms.
2121
/// This includes standard search templates (BFS, DFS, PFS), shortest path finders
2222
/// (Dijkstra), minimum spanning trees (Prim), and topological sorting. Algorithms
2323
/// are designed to operate seamlessly via callbacks and property maps.
2424

25-
/// @defgroup gl_topo Graph Topology Generators
26-
/// @ingroup gl
25+
/// @defgroup GL-Topology Graph Topologies
26+
/// @ingroup GL
2727
/// @brief Generators and evaluators for standard graph topologies.
2828
///
2929
/// A collection of utilities for quickly generating commong graph topologies.
3030
/// This includes cliques (complete graphs), bipartite graphs, binary trees, paths, and cycles.
3131

32-
/// @defgroup gl_io Input/Output Utility
33-
/// @ingroup gl
32+
/// @defgroup GL-IO I/O Utility
33+
/// @ingroup GL
3434
/// @brief I/O stream support, parsing, and range-based formatting.
3535
///
3636
/// Facilities for reading, writing, and formatting graph data. This group provides the stream
3737
/// manipulators, configuration options, and format traits necessary to seamlessly serialize and
3838
/// visualize graph structures, and parse data from standard streams or files.
3939

40-
/// @defgroup gl_traits Traits & Concepts
41-
/// @ingroup gl
40+
/// @defgroup GL-Traits Traits & Concepts
41+
/// @ingroup GL
4242
/// @brief Type traits, constraints, and metaprogramming utilities.
4343
///
4444
/// Encapsulates the `gl::traits` namespace. These components are used extensively throughout the
4545
/// library to constrain template parameters and interrogate types at compile time (e.g., deducing
4646
/// underlying vertex/edge types, querying graph directedness, or enforcing structural constraints).
4747

48-
/// @defgroup gl_types Generic Data Types
49-
/// @ingroup gl
48+
/// @defgroup GL-Types Generic Types
49+
/// @ingroup GL
5050
/// @brief Independent, reusable structures and containers.
5151
///
5252
/// Contains highly generic data structures like `flat_matrix` and `flat_jagged_vector`.
5353
/// While these form the memory backbone of the graph implementations, they are completely
5454
/// decoupled from the graph logic and can be safely utilized in general-purpose programming contexts.
5555

56-
/// @defgroup gl_util General Utilities
57-
/// @ingroup gl
56+
/// @defgroup GL-Util General Utilities
57+
/// @ingroup GL
5858
/// @brief Practical, domain-agnostic C++ helpers and polyfills.
5959
///
6060
/// While these utilities were built to facilitate the library's internal graph modeling

include/gl/algorithm/templates/bfs.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace gl::algorithm {
1414

15-
/// @ingroup gl_alg
15+
/// @ingroup GL-Algorithm
1616
template <
1717
traits::c_graph G,
1818
traits::c_forward_range_of<search_node<G>> InitQueueRangeType = std::vector<search_node<G>>,

include/gl/graph.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct to_impl;
6868
} // namespace detail
6969

7070
/// @brief A general-purpose graph container.
71-
/// @ingroup gl
71+
/// @ingroup GL
7272
///
7373
/// This class represents a highly customizable graph data structure configured by the provided
7474
/// `GraphTraits`. It serves as the primary interface for managing vertices, edges, and their properties.
@@ -106,9 +106,9 @@ struct to_impl;
106106
/// ```
107107
///
108108
/// ### References
109-
/// For a general overview and integration instructions, see the [Project Overview](/#overview)
110-
/// or the [Installation Guide](/#installing-the-library).
111-
/// A simple reference [MAIN PAGE](/)
109+
/// For a general overview and integration instructions, see the [Project Overview](../index.md#overview)
110+
/// or the [Installation Guide](../index.md#installing-the-library).
111+
/// A simple reference [MAIN PAGE](../index.md#)
112112
///
113113
/// > [!NOTE]
114114
/// > Highlights information that users should take into account, even when skimming.

include/gl/vertex_descriptor.hpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// This file is part of the CPP-GL project (https://github.com/SpectraL519/cpp-gl).
33
// Licensed under the MIT License. See the LICENSE file in the project root for full license information.
44

5+
/// @file vertex_descriptor.hpp
6+
/// @brief Defines the vertex_descriptor class, a lightweight wrapper for vertex representations in graphs.
7+
58
#pragma once
69

710
#include "gl/attributes/force_inline.hpp"
@@ -17,92 +20,123 @@
1720

1821
namespace gl {
1922

23+
/// @ingroup GL GL-Core
24+
/// @brief A lightweight wrapper around a vertex identifier with optional properties.
25+
///
26+
/// **Module:** Part of the @ref GL-Core "Core Graph Components" group.
27+
///
28+
/// The vertex_descriptor class provides a type-safe and efficient way to represent
29+
/// vertices in graph structures. It acts as a lightweight wrapper that combines
30+
/// a unique identifier with optional property data, ensuring safe access and
31+
/// comparison operations.
2032
template <
2133
traits::c_properties Properties = empty_properties,
2234
traits::c_id_type IdType = default_id_type>
2335
class vertex_descriptor final {
2436
public:
37+
/// @brief Type alias for the vertex_descriptor itself.
2538
using type = std::type_identity_t<vertex_descriptor<Properties, IdType>>;
39+
/// @brief The type used for vertex identifiers.
2640
using id_type = IdType;
41+
/// @brief The type of properties associated with the vertex.
2742
using properties_type = Properties;
2843

44+
/// @brief Default constructor, initializes to an invalid vertex.
2945
vertex_descriptor() {
3046
*this = vertex_descriptor::invalid();
3147
}
3248

49+
/// @brief Constructs a vertex descriptor with the given ID (for empty properties).
3350
explicit vertex_descriptor(const id_type id)
3451
requires(traits::c_empty_properties<properties_type>)
3552
: _id(id) {}
3653

54+
/// @brief Constructs a vertex descriptor with the given ID and properties.
3755
explicit vertex_descriptor(const id_type id, properties_type& properties)
3856
requires(traits::c_non_empty_properties<properties_type>)
3957
: _id(id), _properties(properties) {}
4058

59+
/// @brief Returns an invalid vertex descriptor (for empty properties).
4160
[[nodiscard]] gl_attr_force_inline static vertex_descriptor invalid() noexcept
4261
requires(traits::c_empty_properties<properties_type>)
4362
{
4463
return vertex_descriptor(invalid_id);
4564
}
4665

66+
/// @brief Returns an invalid vertex descriptor (for non-empty properties).
4767
[[nodiscard]] gl_attr_force_inline static vertex_descriptor invalid() noexcept
4868
requires(traits::c_non_empty_properties<properties_type>)
4969
{
5070
static properties_type invalid_properties{};
5171
return vertex_descriptor(invalid_id, invalid_properties);
5272
}
5373

74+
/// @brief Copy constructor.
5475
vertex_descriptor(const vertex_descriptor&) = default;
76+
/// @brief Copy assignment operator.
5577
vertex_descriptor& operator=(const vertex_descriptor&) = default;
5678

79+
/// @brief Move constructor.
5780
vertex_descriptor(vertex_descriptor&&) noexcept = default;
81+
/// @brief Move assignment operator.
5882
vertex_descriptor& operator=(vertex_descriptor&&) noexcept = default;
5983

84+
/// @brief Destructor.
6085
~vertex_descriptor() = default;
6186

87+
/// @brief Equality comparison operator.
6288
[[nodiscard]] gl_attr_force_inline bool operator==(const vertex_descriptor& other
6389
) const noexcept {
6490
return this->_id == other._id;
6591
}
6692

93+
/// @brief Three-way comparison operator.
6794
[[nodiscard]] gl_attr_force_inline std::strong_ordering operator<=>(
6895
const vertex_descriptor& other
6996
) const noexcept {
7097
return this->_id <=> other._id;
7198
}
7299

100+
/// @brief Boolean conversion operator, returns true if the vertex is valid.
73101
[[nodiscard]] gl_attr_force_inline operator bool() const noexcept {
74102
return this->is_valid();
75103
}
76104

105+
/// @brief Checks if the vertex descriptor is valid.
77106
[[nodiscard]] gl_attr_force_inline bool is_valid() const noexcept {
78107
return this->_id != invalid_id;
79108
}
80109

110+
/// @brief Returns the vertex ID.
81111
[[nodiscard]] gl_attr_force_inline id_type id() const noexcept {
82112
return this->_id;
83113
}
84114

115+
/// @brief Returns a reference to the vertex properties.
85116
[[nodiscard]] gl_attr_force_inline properties_type& properties() const
86117
requires(traits::c_non_empty_properties<properties_type>)
87118
{
88119
this->_validate();
89120
return this->_properties.get();
90121
}
91122

123+
/// @brief Arrow operator for accessing properties.
92124
[[nodiscard]] gl_attr_force_inline properties_type* operator->() const
93125
requires(traits::c_non_empty_properties<properties_type>)
94126
{
95127
this->_validate();
96128
return &this->_properties.get();
97129
}
98130

131+
/// @brief Dereference operator for accessing properties.
99132
[[nodiscard]] gl_attr_force_inline properties_type& operator*() const
100133
requires(traits::c_non_empty_properties<properties_type>)
101134
{
102135
this->_validate();
103136
return this->_properties.get();
104137
}
105138

139+
/// @brief Output stream operator for vertex descriptors.
106140
friend std::ostream& operator<<(std::ostream& os, const vertex_descriptor& vertex) {
107141
using enum io::detail::option_bit;
108142

mkdocs.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,23 @@ repo_url: "https://github.com/SpectraL519/cpp-gl"
55
nav:
66
- Home: index.md
77
- GL:
8-
# TODO: Overview/Tutorial
9-
- Core: cpp-gl/group__gl__core.md
10-
- Algorithms: cpp-gl/group__gl__alg.md
11-
- Topologies: cpp-gl/group__gl__topo.md
12-
- I/O: cpp-gl/group__gl__io.md
13-
- Traits & Concepts: cpp-gl/group__gl__traits.md
14-
- Generic Types: cpp-gl/group__gl__types.md
15-
- Utilities: cpp-gl/group__gl__util.md
8+
# TODO: Tutorial page
9+
- Overview: cpp-gl/group__GL.md
10+
- Core Graph Components: cpp-gl/group__GL-Core.md
11+
- Graph Algorithms: cpp-gl/group__GL-Algorithm.md
12+
- Graph Topologies: cpp-gl/group__GL-Topology.md
13+
- I/O Utility: cpp-gl/group__GL-IO.md
14+
- Traits & Concepts: cpp-gl/group__GL-Traits.md
15+
- Generic Types: cpp-gl/group__GL-Types.md
16+
- General Utilities: cpp-gl/group__GL-Util.md
1617
# - HGL:
1718
# - Overview: cpp-gl/group__hgl.md
1819
# - Algorithms: cpp-gl/group__hgl__alg.md
1920
- API Index:
2021
- Namespaces: cpp-gl/namespaces.md
2122
- Classes & Structs: cpp-gl/annotated.md
2223
- Files: cpp-gl/files.md
24+
# TODO: Other sections (constants, functions, modules, etc...)
2325

2426
theme:
2527
name: material

0 commit comments

Comments
 (0)