Loading...
Searching...
No Matches
Int64Builder.h
Go to the documentation of this file.
1// BSD 3-Clause License; see https://github.com/scikit-hep/awkward/blob/main/LICENSE
2
3#ifndef AWKWARD_INT64BUILDER_H_
4#define AWKWARD_INT64BUILDER_H_
5
6#include "awkward/common.h"
10
11namespace awkward {
12
17 public:
21 static const BuilderPtr
22 fromempty(const BuilderOptions& options);
23
31
35
37 const std::string
38 classname() const override;
39
40 const std::string
41 to_buffers(BuffersContainer& container, int64_t& form_key_id) const override;
42
43 int64_t
44 length() const override;
45
46 void
47 clear() override;
48
52 bool
53 active() const override;
54
55 const BuilderPtr
56 null() override;
57
58 const BuilderPtr
59 boolean(bool x) override;
60
61 const BuilderPtr
62 integer(int64_t x) override;
63
64 const BuilderPtr
65 real(double x) override;
66
67 const BuilderPtr
68 complex(std::complex<double> x) override;
69
70 const BuilderPtr
71 datetime(int64_t x, const std::string& unit) override;
72
73 const BuilderPtr
74 timedelta(int64_t x, const std::string& unit) override;
75
76 const BuilderPtr
77 string(const char* x, int64_t length, const char* encoding) override;
78
79 const BuilderPtr
80 beginlist() override;
81
82 const BuilderPtr
83 endlist() override;
84
85 const BuilderPtr
86 begintuple(int64_t numfields) override;
87
88 const BuilderPtr
89 index(int64_t index) override;
90
91 const BuilderPtr
92 endtuple() override;
93
94 const BuilderPtr
95 beginrecord(const char* name, bool check) override;
96
97 void
98 field(const char* key, bool check) override;
99
100 const BuilderPtr
101 endrecord() override;
102
103 const BuilderOptions&
104 options() const { return options_; }
105
106 private:
107 const BuilderOptions options_;
109 };
110}
111
112#endif // AWKWARD_INT64BUILDER_H_
Abstract class to represent the output of ak.to_buffers. In Python, this would be a dict of NumPy arr...
Definition Builder.h:20
Abstract base class for nodes within an ArrayBuilder that cumulatively discover an array's type and f...
Definition Builder.h:41
Discontiguous, one-dimensional buffer (which consists of multiple contiguous, one-dimensional panels)...
Definition GrowableBuffer.h:233
Builder node that accumulates integers (int64_t).
Definition Int64Builder.h:16
const BuilderPtr real(double x) override
Adds a real value x to the accumulated data.
const BuilderPtr endlist() override
Ends a nested list.
static const BuilderPtr fromempty(const BuilderOptions &options)
Create an empty Int64Builder.
GrowableBuffer< int64_t > buffer()
Contains the accumulated integers.
const BuilderPtr timedelta(int64_t x, const std::string &unit) override
Adds a timedelta value x to the accumulated data.
void field(const char *key, bool check) override
Sets the pointer to a given record field key; the next command will fill that slot.
const BuilderPtr complex(std::complex< double > x) override
Adds a complex value x to the accumulated data.
const BuilderPtr index(int64_t index) override
Sets the pointer to a given tuple field index; the next command will fill that slot.
int64_t length() const override
Current length of the accumulated array.
const BuilderPtr endrecord() override
Ends a record.
bool active() const override
If true, this node has started but has not finished a multi-step command (e.g. beginX ....
const BuilderPtr string(const char *x, int64_t length, const char *encoding) override
Adds a string value x with a given length and encoding to the accumulated data.
const BuilderOptions & options() const
Definition Int64Builder.h:104
const BuilderPtr integer(int64_t x) override
Adds an integer value x to the accumulated data.
const BuilderPtr datetime(int64_t x, const std::string &unit) override
Adds a datetime value x to the accumulated data.
const BuilderPtr beginrecord(const char *name, bool check) override
Begins building a record with an optional name.
Int64Builder(const BuilderOptions &options, GrowableBuffer< int64_t > buffer)
Create an Int64Builder from a full set of parameters.
const BuilderPtr null() override
Adds a null value to the accumulated data.
const std::string to_buffers(BuffersContainer &container, int64_t &form_key_id) const override
Copy the current snapshot into the BuffersContainer and return a Form as a std::string (JSON).
const BuilderPtr beginlist() override
Begins building a nested list.
const BuilderPtr boolean(bool x) override
Adds a boolean value x to the accumulated data.
const BuilderPtr begintuple(int64_t numfields) override
Begins building a tuple with a fixed number of fields.
const BuilderPtr endtuple() override
Ends a tuple.
const std::string classname() const override
User-friendly name of this class: "Int64Builder".
void clear() override
Removes all accumulated data without resetting the type knowledge.
#define EXPORT_SYMBOL
Definition common.h:25
Definition ArrayBuilder.h:14
std::shared_ptr< Builder > BuilderPtr
Definition ArrayBuilder.h:16
Container for all configuration options needed by ArrayBuilder, GrowableBuffer, LayoutBuilder and the...
Definition BuilderOptions.h:20