Awkward Array: include/awkward/builder/BoolBuilder.h Source File

Loading...
Searching...
No Matches
BoolBuilder.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_BOOLBUILDER_H_
4#define AWKWARD_BOOLBUILDER_H_
5
6#include <complex>
7#include <string>
8
9#include "awkward/common.h"
10#include "awkward/BuilderOptions.h"
11#include "awkward/GrowableBuffer.h"
12#include "awkward/builder/Builder.h"
13
14namespace awkward {
15
19 class LIBAWKWARD_EXPORT_SYMBOL BoolBuilder: public Builder {
20 public:
24 static const BuilderPtr
25 fromempty(const BuilderOptions& options);
26
32 BoolBuilder(const BuilderOptions& options,
33 GrowableBuffer<uint8_t> buffer);
34
36 const std::string
37 classname() const override;
38
39 const std::string
40 to_buffers(BuffersContainer& container, int64_t& form_key_id) const override;
41
42 int64_t
43 length() const override;
44
45 void
46 clear() override;
47
51 bool
52 active() const override;
53
54 const BuilderPtr
55 null() override;
56
57 const BuilderPtr
58 boolean(bool x) override;
59
60 const BuilderPtr
61 integer(int64_t x) override;
62
63 const BuilderPtr
64 real(double x) override;
65
66 const BuilderPtr
67 complex(std::complex<double> x) override;
68
69 const BuilderPtr
70 datetime(int64_t x, const std::string& unit) override;
71
72 const BuilderPtr
73 timedelta(int64_t x, const std::string& unit) override;
74
75 const BuilderPtr
76 string(const char* x, int64_t length, const char* encoding) override;
77
78 const BuilderPtr
79 beginlist() override;
80
81 const BuilderPtr
82 endlist() override;
83
84 const BuilderPtr
85 begintuple(int64_t numfields) override;
86
87 const BuilderPtr
88 index(int64_t index) override;
89
90 const BuilderPtr
91 endtuple() override;
92
93 const BuilderPtr
94 beginrecord(const char* name, bool check) override;
95
96 void
97 field(const char* key, bool check) override;
98
99 const BuilderPtr
100 endrecord() override;
101
102 const BuilderOptions&
103 options() const { return options_; }
104
105 const GrowableBuffer<uint8_t>& buffer() const { return buffer_; }
106
107 private:
108 const BuilderOptions options_;
109 GrowableBuffer<uint8_t> buffer_;
110 };
111
112}
113
114#endif // AWKWARD_BOOLBUILDER_H_
BuilderOptions.h
Builder.h
GrowableBuffer.h
awkward::BoolBuilder
Builder node that accumulates boolean values.
Definition: BoolBuilder.h:19
awkward::BoolBuilder::real
const BuilderPtr real(double x) override
Adds a real value x to the accumulated data.
awkward::BoolBuilder::endlist
const BuilderPtr endlist() override
Ends a nested list.
awkward::BoolBuilder::fromempty
static const BuilderPtr fromempty(const BuilderOptions &options)
Create an empty BoolBuilder.
awkward::BoolBuilder::timedelta
const BuilderPtr timedelta(int64_t x, const std::string &unit) override
Adds a timedelta value x to the accumulated data.
awkward::BoolBuilder::field
void field(const char *key, bool check) override
Sets the pointer to a given record field key; the next command will fill that slot.
awkward::BoolBuilder::complex
const BuilderPtr complex(std::complex< double > x) override
Adds a complex value x to the accumulated data.
awkward::BoolBuilder::index
const BuilderPtr index(int64_t index) override
Sets the pointer to a given tuple field index; the next command will fill that slot.
awkward::BoolBuilder::length
int64_t length() const override
Current length of the accumulated array.
awkward::BoolBuilder::endrecord
const BuilderPtr endrecord() override
Ends a record.
awkward::BoolBuilder::active
bool active() const override
If true, this node has started but has not finished a multi-step command (e.g. beginX ....
awkward::BoolBuilder::string
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.
awkward::BoolBuilder::options
const BuilderOptions & options() const
Definition: BoolBuilder.h:103
awkward::BoolBuilder::buffer
const GrowableBuffer< uint8_t > & buffer() const
Definition: BoolBuilder.h:105
awkward::BoolBuilder::integer
const BuilderPtr integer(int64_t x) override
Adds an integer value x to the accumulated data.
awkward::BoolBuilder::datetime
const BuilderPtr datetime(int64_t x, const std::string &unit) override
Adds a datetime value x to the accumulated data.
awkward::BoolBuilder::beginrecord
const BuilderPtr beginrecord(const char *name, bool check) override
Begins building a record with an optional name.
awkward::BoolBuilder::null
const BuilderPtr null() override
Adds a null value to the accumulated data.
awkward::BoolBuilder::to_buffers
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).
awkward::BoolBuilder::beginlist
const BuilderPtr beginlist() override
Begins building a nested list.
awkward::BoolBuilder::boolean
const BuilderPtr boolean(bool x) override
Adds a boolean value x to the accumulated data.
awkward::BoolBuilder::BoolBuilder
BoolBuilder(const BuilderOptions &options, GrowableBuffer< uint8_t > buffer)
Create a BoolBuilder from a full set of parameters.
awkward::BoolBuilder::begintuple
const BuilderPtr begintuple(int64_t numfields) override
Begins building a tuple with a fixed number of fields.
awkward::BoolBuilder::endtuple
const BuilderPtr endtuple() override
Ends a tuple.
awkward::BoolBuilder::classname
const std::string classname() const override
User-friendly name of this class: "BoolBuilder".
awkward::BoolBuilder::clear
void clear() override
Removes all accumulated data without resetting the type knowledge.
awkward::BuffersContainer
Abstract class to represent the output of ak.to_buffers. In Python, this would be a dict of NumPy arr...
Definition: Builder.h:20
awkward::Builder
Abstract base class for nodes within an ArrayBuilder that cumulatively discover an array's type and f...
Definition: Builder.h:41
awkward::GrowableBuffer
Discontiguous, one-dimensional buffer (which consists of multiple contiguous, one-dimensional panels)...
Definition: GrowableBuffer.h:174
common.h
LIBAWKWARD_EXPORT_SYMBOL
#define LIBAWKWARD_EXPORT_SYMBOL
Definition: common.h:45
awkward
Definition: BitMaskedArray.h:15
awkward::BuilderPtr
std::shared_ptr< Builder > BuilderPtr
Definition: ArrayBuilder.h:16
awkward::Options
Container for all configuration options needed by ArrayBuilder, GrowableBuffer, LayoutBuilder and the...
Definition: BuilderOptions.h:20