Skip to content

Commit f0e9bf8

Browse files
committed
GH-46818: [Docs][C++] Add missing method description in type.h
1 parent f082d31 commit f0e9bf8

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

cpp/src/arrow/type.h

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,9 @@ class ARROW_EXPORT DecimalType : public FixedSizeBinaryType {
10141014
static Result<std::shared_ptr<DataType>> Make(Type::type type_id, int32_t precision,
10151015
int32_t scale);
10161016

1017+
/// \brief Returns the precision
10171018
int32_t precision() const { return precision_; }
1019+
/// \brief Returns the scale
10181020
int32_t scale() const { return scale_; }
10191021

10201022
/// \brief Returns the number of bytes needed for precision.
@@ -1337,20 +1339,25 @@ class ARROW_EXPORT MapType : public ListType {
13371339

13381340
explicit MapType(std::shared_ptr<Field> value_field, bool keys_sorted = false);
13391341

1340-
// Validating constructor
1342+
/// Validating constructor
13411343
static Result<std::shared_ptr<DataType>> Make(std::shared_ptr<Field> value_field,
13421344
bool keys_sorted = false);
13431345

1346+
/// \brief Returns the key field
13441347
std::shared_ptr<Field> key_field() const { return value_type()->field(0); }
1348+
/// \brief Returns the key type
13451349
std::shared_ptr<DataType> key_type() const { return key_field()->type(); }
13461350

1351+
/// \brief Returns the item field
13471352
std::shared_ptr<Field> item_field() const { return value_type()->field(1); }
1353+
/// \brief Returns the item type
13481354
std::shared_ptr<DataType> item_type() const { return item_field()->type(); }
13491355

13501356
std::string ToString(bool show_metadata = false) const override;
13511357

13521358
std::string name() const override { return "map"; }
13531359

1360+
/// \brief Returns the keys sorted
13541361
bool keys_sorted() const { return keys_sorted_; }
13551362

13561363
private:
@@ -1387,6 +1394,7 @@ class ARROW_EXPORT FixedSizeListType : public BaseListType {
13871394

13881395
std::string name() const override { return "fixed_size_list"; }
13891396

1397+
/// \brief Returns the list size
13901398
int32_t list_size() const { return list_size_; }
13911399

13921400
protected:
@@ -1471,8 +1479,10 @@ class ARROW_EXPORT UnionType : public NestedType {
14711479
/// An array mapping logical type ids to physical child ids.
14721480
const std::vector<int>& child_ids() const { return child_ids_; }
14731481

1482+
/// \brief Returns the max type code
14741483
uint8_t max_type_code() const;
14751484

1485+
/// \brief Returns the mode
14761486
UnionMode::type mode() const;
14771487

14781488
protected:
@@ -1508,7 +1518,7 @@ class ARROW_EXPORT SparseUnionType : public UnionType {
15081518

15091519
SparseUnionType(FieldVector fields, std::vector<int8_t> type_codes);
15101520

1511-
// A constructor variant that validates input parameters
1521+
/// A constructor variant that validates input parameters
15121522
static Result<std::shared_ptr<DataType>> Make(FieldVector fields,
15131523
std::vector<int8_t> type_codes);
15141524

@@ -1537,7 +1547,7 @@ class ARROW_EXPORT DenseUnionType : public UnionType {
15371547

15381548
DenseUnionType(FieldVector fields, std::vector<int8_t> type_codes);
15391549

1540-
// A constructor variant that validates input parameters
1550+
/// A constructor variant that validates input parameters
15411551
static Result<std::shared_ptr<DataType>> Make(FieldVector fields,
15421552
std::vector<int8_t> type_codes);
15431553

@@ -1560,13 +1570,16 @@ class ARROW_EXPORT RunEndEncodedType : public NestedType {
15601570
return DataTypeLayout({DataTypeLayout::AlwaysNull()});
15611571
}
15621572

1573+
/// \brief Returns the run-end encoded type
15631574
const std::shared_ptr<DataType>& run_end_type() const { return fields()[0]->type(); }
1575+
/// \brief Returns the run-end encoded value type
15641576
const std::shared_ptr<DataType>& value_type() const { return fields()[1]->type(); }
15651577

15661578
std::string ToString(bool show_metadata = false) const override;
15671579

15681580
std::string name() const override { return "run_end_encoded"; }
15691581

1582+
/// \brief Returns run-end encoded type is valid
15701583
static bool RunEndTypeValid(const DataType& run_end_type);
15711584

15721585
private:
@@ -1599,6 +1612,7 @@ class ARROW_EXPORT TemporalType : public FixedWidthType {
15991612
/// \brief Base type class for date data
16001613
class ARROW_EXPORT DateType : public TemporalType {
16011614
public:
1615+
/// \brief Returns the unit
16021616
virtual DateUnit unit() const = 0;
16031617

16041618
protected:
@@ -1773,6 +1787,7 @@ class ARROW_EXPORT IntervalType : public TemporalType, public ParametricType {
17731787
public:
17741788
enum type { MONTHS, DAY_TIME, MONTH_DAY_NANO };
17751789

1790+
/// \brief Returns the interval type
17761791
virtual type interval_type() const = 0;
17771792

17781793
protected:
@@ -1907,6 +1922,7 @@ class ARROW_EXPORT DurationType : public TemporalType, public ParametricType {
19071922
std::string ToString(bool show_metadata = false) const override;
19081923
std::string name() const override { return "duration"; }
19091924

1925+
/// \brief Returns the unit
19101926
TimeUnit::type unit() const { return unit_; }
19111927

19121928
protected:
@@ -1945,9 +1961,12 @@ class ARROW_EXPORT DictionaryType : public FixedWidthType {
19451961

19461962
DataTypeLayout layout() const override;
19471963

1964+
/// \brief Returns the index type
19481965
const std::shared_ptr<DataType>& index_type() const { return index_type_; }
1966+
/// \brief Returns the value type
19491967
const std::shared_ptr<DataType>& value_type() const { return value_type_; }
19501968

1969+
/// \brief Returns the ordered
19511970
bool ordered() const { return ordered_; }
19521971

19531972
protected:
@@ -2362,8 +2381,10 @@ class ARROW_EXPORT Schema : public detail::Fingerprintable,
23622381
/// Return the ith schema element. Does not boundscheck
23632382
const std::shared_ptr<Field>& field(int i) const;
23642383

2384+
/// \brief Returns fields
23652385
const FieldVector& fields() const;
23662386

2387+
/// \brief Returns field names
23672388
std::vector<std::string> field_names() const;
23682389

23692390
/// Returns null if name not found

0 commit comments

Comments
 (0)