Loading...
Searching...
No Matches
RegularType.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_REGULARTYPE_H_
4#define AWKWARD_REGULARTYPE_H_
5
6#include <vector>
7
8#include "awkward/common.h"
9#include "awkward/util.h"
10#include "awkward/type/Type.h"
11
12namespace awkward {
20 public:
30 RegularType(const util::Parameters& parameters,
31 const std::string& typestr,
32 const TypePtr& type,
33 int64_t size);
34
36 const TypePtr
37 type() const;
38
41 int64_t
42 size() const;
43
44 std::string
45 tostring_part(const std::string& indent,
46 const std::string& pre,
47 const std::string& post) const override;
48
49 const TypePtr
50 shallow_copy() const override;
51
52 bool
53 equal(const TypePtr& other, bool check_parameters) const override;
54
55 int64_t
56 numfields() const override;
57
58 int64_t
59 fieldindex(const std::string& key) const override;
60
61 const std::string
62 key(int64_t fieldindex) const override;
63
64 bool
65 haskey(const std::string& key) const override;
66
67 const std::vector<std::string>
68 keys() const override;
69
70 const ContentPtr
71 empty() const override;
72
73 private:
75 const TypePtr type_;
77 const int64_t size_;
78 };
79}
80
81#endif // AWKWARD_REGULARTYPE_H_
Describes the high level type of lists of a given length, as opposed to ListType.
Definition: RegularType.h:19
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.
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 size() const
The length of each list (which is part of the type specification).
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 nested lists.
bool equal(const TypePtr &other, bool check_parameters) const override
Returns true if this type is equal to other; false otherwise.
RegularType(const util::Parameters &parameters, const std::string &typestr, const TypePtr &type, int64_t size)
Create a RegularType with a full set of parameters.
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