From b8f8dfad436df0b6f19d6142670de98ddb6e3608 Mon Sep 17 00:00:00 2001 From: parker Date: Wed, 20 Aug 2025 16:22:58 +0100 Subject: [PATCH] docs: add doxygen comments for GeometryConnection class --- src/Engine/Operator/GeometryConnection.h | 40 +++++++++++++++++++++--- src/Engine/Types.h | 3 ++ 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/Engine/Operator/GeometryConnection.h b/src/Engine/Operator/GeometryConnection.h index 17eef0e..7368d58 100644 --- a/src/Engine/Operator/GeometryConnection.h +++ b/src/Engine/Operator/GeometryConnection.h @@ -6,24 +6,56 @@ namespace enzo::nt { class GeometryOperator; + +/** +* @class GeometryConnection +* @brief Directional edges to connect nodes +* +* +* @todo Currently geometry connections are stored on nodes. It might +* make more sense to move them to a container within the network manager +* so they're all in the same place +* +* Input and output are in relation to data flow. +* +* @todo Currently geometry connections are stored on nodes. It might +* make more sense to move them to a container within the network manager +* so they're all in the same place +*/ + class GeometryConnection { public: - // input and output are in relation to data flow - // the input node is the node the data flows from - // the output node is the node the data flows to - GeometryConnection(enzo::nt::OpId inputOpId, unsigned int inputIndex, enzo::nt::OpId outputOpId, unsigned int outputIndex); + /** + * @brief Constructs a connection between two nodes + * + * Input and output are in relation to data flow. + * + * @param inputOpId The [Operator ID](@ref OpId) in which data flows from. + * @param outputOpId The [Operator ID](@ref OpId) in which data flows to. + * @param inputOpIndex The output socket number of @p inputOpId in which data flows from. + * @param outputOpIndex The input socket number of @p outputOpId in which data flows to. + */ + GeometryConnection(enzo::nt::OpId inputOpId, unsigned int inputOpIndex, enzo::nt::OpId outputOpId, unsigned int outputOpIndex); + /// @brief Returns the [Operator ID](@ref OpId) of the connection input (where data flows from). enzo::nt::OpId getInputOpId() const; + /// @brief Returns the [Operator ID](@ref OpId) of the connection output (where data flows to). enzo::nt::OpId getOutputOpId() const; + /// @brief Returns the socket number of #getInputOpId in which data flows from. unsigned int getInputIndex() const; + /// @brief Returns the socket number of #getOutputOpId in which data flows to. unsigned int getOutputIndex() const; + + /// @brief Provides an ostream representation of the connection, useful for debugging. friend std::ostream& operator<<(std::ostream& os, const GeometryConnection& p) { return os << p.inputOperatorId_ << ":" << p.inputIndex_ << " -> " << p.outputOperatorId_ << ":" << p.outputIndex_ << "\n"; } + /// @brief A signal emitted when the connection is removed boost::signals2::signal removed; + /// @brief Removes the connection from it's associated nodes. Does not delete the object. void remove(); // bool isValid(); private: diff --git a/src/Engine/Types.h b/src/Engine/Types.h index 947fe08..a6468b6 100644 --- a/src/Engine/Types.h +++ b/src/Engine/Types.h @@ -74,6 +74,9 @@ namespace enzo } namespace nt { + /** + * @brief The unique ID assigned to each node in the network. + */ using OpId = uint64_t; enum class SocketIOType {