Skip to content

Commit

Permalink
GH-40318: [C++][Docs] Add documentation of array factories (#40373)
Browse files Browse the repository at this point in the history
### Rationale for this change

These factory functions are generally useful and available, so documenting them helps external users find them without having to search the source code.

### What changes are included in this PR?

This PR adds the array factories in arrow/array/util.h into a doxygen group for array factories and adds that group to the Sphinx C++ API documentation.

### Are these changes tested?

I built the docs locally to verify.

### Are there any user-facing changes?

Nothing to the API, only docs.

* GitHub Issue: #40318

Authored-by: Vyas Ramasubramani <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
  • Loading branch information
vyasr authored Mar 7, 2024
1 parent e950eb4 commit 1c9a312
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cpp/src/arrow/array/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

namespace arrow {

/// \defgroup array-factories Array factory functions
///
/// @{

/// \brief Create a strongly-typed Array instance from generic ArrayData
/// \param[in] data the array contents
/// \return the resulting Array instance
Expand Down Expand Up @@ -65,6 +69,8 @@ ARROW_EXPORT
Result<std::shared_ptr<Array>> MakeEmptyArray(std::shared_ptr<DataType> type,
MemoryPool* pool = default_memory_pool());

/// @}

namespace internal {

/// \brief Swap endian of each element in a generic ArrayData
Expand Down
8 changes: 7 additions & 1 deletion docs/source/cpp/api/array.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ Arrays
:project: arrow_cpp
:members:

Factory functions
=================

.. doxygengroup:: array-factories
:content-only:

Concrete array subclasses
=========================

Expand Down Expand Up @@ -86,4 +92,4 @@ Utilities
.. doxygenclass:: arrow::ArrayVisitor
:project: arrow_cpp
:members:
:undoc-members:
:undoc-members:

0 comments on commit 1c9a312

Please sign in to comment.