PrimitiveType.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_PRIMITIVETYPE_H_
4 #define AWKWARD_PRIMITIVETYPE_H_
5 
6 #include "awkward/common.h"
7 #include "awkward/util.h"
8 #include "awkward/type/Type.h"
9 
10 namespace awkward {
18  public:
26  PrimitiveType(const util::Parameters& parameters,
27  const std::string& typestr, util::dtype dtype);
28 
31  dtype() const;
32 
33  std::string
34  tostring_part(const std::string& indent,
35  const std::string& pre,
36  const std::string& post) const override;
37 
38  const TypePtr
39  shallow_copy() const override;
40 
41  bool
42  equal(const TypePtr& other, bool check_parameters) const override;
43 
44  int64_t
45  numfields() const override;
46 
47  int64_t
48  fieldindex(const std::string& key) const override;
49 
50  const std::string
51  key(int64_t fieldindex) const override;
52 
53  bool
54  haskey(const std::string& key) const override;
55 
56  const std::vector<std::string>
57  keys() const override;
58 
59  const ContentPtr
60  empty() const override;
61 
62  private:
64  const util::dtype dtype_;
65  };
66 
67 }
68 
69 #endif // AWKWARD_PRIMITIVETYPE_H_
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
const std::string key(const RecordLookupPtr &recordlookup, int64_t fieldindex, int64_t numfields)
Returns the key associated with a field index, given a RecordLookup and a number of fields...
Definition: BitMaskedArray.h:15
Abstract superclass of all high level types (flat hierarchy).
Definition: Type.h:23
const std::vector< std::string > keys(const RecordLookupPtr &recordlookup, int64_t numfields)
Returns a given RecordLookup as keys or generate anonymous ones form a number of fields.
Describes the high level type of an array that contains fixed-size items, such as numbers or booleans...
Definition: PrimitiveType.h:17
dtype
NumPy dtypes that can be interpreted within Awkward C++ (only the primitive, fixed-width types)...
Definition: util.h:26
std::map< std::string, std::string > Parameters
Definition: util.h:165
int64_t fieldindex(const RecordLookupPtr &recordlookup, const std::string &key, int64_t numfields)
Returns the field index associated with a key, given a RecordLookup and a number of fields...
bool haskey(const RecordLookupPtr &recordlookup, const std::string &key, int64_t numfields)
Returns true if a RecordLookup has a given key; false otherwise.
std::shared_ptr< Type > TypePtr
Definition: Content.h:23
std::shared_ptr< Content > ContentPtr
Definition: ArrayBuilder.h:16