Loading...
Searching...
No Matches
ArrayType.h
Go to the documentation of this file.
1// BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
2
3#ifndef AWKWARD_ARRAYTYPE_H_
4#define AWKWARD_ARRAYTYPE_H_
5
6#include "awkward/common.h"
7#include "awkward/util.h"
8#include "awkward/type/Type.h"
9
10namespace awkward {
19 public:
27 ArrayType(const util::Parameters& parameters,
28 const std::string& typestr,
29 const TypePtr& type,
30 int64_t length);
31
33 const TypePtr
34 type() const;
35
37 int64_t
38 length() const;
39
40 std::string
41 tostring_part(const std::string& indent,
42 const std::string& pre,
43 const std::string& post) const override;
44
45 const TypePtr
46 shallow_copy() const override;
47
48 bool
49 equal(const TypePtr& other, bool check_parameters) const override;
50
51 int64_t
52 numfields() const override;
53
54 int64_t
55 fieldindex(const std::string& key) const override;
56
57 const std::string
58 key(int64_t fieldindex) const override;
59
60 bool
61 haskey(const std::string& key) const override;
62
63 const std::vector<std::string>
64 keys() const override;
65
66 const ContentPtr
67 empty() const override;
68
69 private:
71 TypePtr type_;
73 int64_t length_;
74 };
75}
76
77#endif // AWKWARD_ARRAYTYPE_H_
Describes the high level type of a user-facing array, i.e. ak.Array in Python, as opposed to Content....
Definition: ArrayType.h:18
std::string tostring_part(const std::string &indent, const std::string &pre, const std::string &post) const override
Internal function to build an output string for tostring.
ArrayType(const util::Parameters &parameters, const std::string &typestr, const TypePtr &type, int64_t length)
Create an ArrayType with a full set of parameters.
const TypePtr shallow_copy() const override
Copies this Type without copying any hierarchically nested types.
int64_t fieldindex(const std::string &key) const override
The position of a tuple or record key name if this array contains a RecordType.
const ContentPtr empty() const override
Returns an empty array (Content) with this type.
const std::vector< std::string > keys() const override
A list of RecordType keys or an empty list if this type does not contain a RecordType.
const std::string key(int64_t fieldindex) const override
The record name associated with a given field index or the tuple index as a string (e....
int64_t numfields() const override
The number of fields in the first nested tuple or records or -1 if this array does not contain a Reco...
bool haskey(const std::string &key) const override
Returns true if the type contains a RecordType with the specified key; false otherwise.
const TypePtr type() const
The Type of the composable Content.
int64_t length() const
The length of the array.
bool equal(const TypePtr &other, bool check_parameters) const override
Returns true if this type is equal to other; false otherwise.
Abstract superclass of all high level types (flat hierarchy).
Definition: Type.h:23
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
std::map< std::string, std::string > Parameters
Definition: util.h:165
Definition: BitMaskedArray.h:15
std::shared_ptr< Content > ContentPtr
Definition: Content.h:15
std::shared_ptr< Type > TypePtr
Definition: Content.h:23