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

Loading...
Searching...
No Matches
Complex128Builder.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_COMPLEX128BUILDER_H_
4#define AWKWARD_COMPLEX128BUILDER_H_
5
6#include "awkward/common.h"
7#include "awkward/BuilderOptions.h"
8#include "awkward/GrowableBuffer.h"
9#include "awkward/builder/Builder.h"
10
11#include <complex>
12
13namespace awkward {
17 class LIBAWKWARD_EXPORT_SYMBOL Complex128Builder: public Builder {
18 public:
22 static const BuilderPtr
23 fromempty(const BuilderOptions& options);
24
29 static const BuilderPtr
30 fromint64(const BuilderOptions& options,
31 const GrowableBuffer<int64_t>& old);
32
37 static const BuilderPtr
38 fromfloat64(const BuilderOptions& options,
39 const GrowableBuffer<double>& old);
40
46 Complex128Builder(const BuilderOptions& options,
47 GrowableBuffer<std::complex<double>> buffer);
48
50 const std::string
51 classname() const override;
52
53 const std::string
54 to_buffers(BuffersContainer& container, int64_t& form_key_id) const override;
55
56 int64_t
57 length() const override;
58
59 void
60 clear() override;
61
65 bool
66 active() const override;
67
68 const BuilderPtr
69 null() override;
70
71 const BuilderPtr
72 boolean(bool x) override;
73
74 const BuilderPtr
75 integer(int64_t x) override;
76
77 const BuilderPtr
78 real(double x) override;
79
80 const BuilderPtr
81 complex(std::complex<double> x) override;
82
83 const BuilderPtr
84 datetime(int64_t x, const std::string& unit) override;
85
86 const BuilderPtr
87 timedelta(int64_t x, const std::string& unit) override;
88
89 const BuilderPtr
90 string(const char* x, int64_t length, const char* encoding) override;
91
92 const BuilderPtr
93 beginlist() override;
94
95 const BuilderPtr
96 endlist() override;
97
98 const BuilderPtr
99 begintuple(int64_t numfields) override;
100
101 const BuilderPtr
102 index(int64_t index) override;
103
104 const BuilderPtr
105 endtuple() override;
106
107 const BuilderPtr
108 beginrecord(const char* name, bool check) override;
109
110 void
111 field(const char* key, bool check) override;
112
113 const BuilderPtr
114 endrecord() override;
115
116 const BuilderOptions&
117 options() const { return options_; }
118
119 const GrowableBuffer<std::complex<double>>& buffer() const { return buffer_; }
120
121 private:
122 const BuilderOptions options_;
123 GrowableBuffer<std::complex<double>> buffer_;
124 };
125
126}
127
128#endif // AWKWARD_COMPLEX128BUILDER_H_
BuilderOptions.h
Builder.h
GrowableBuffer.h
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::Complex128Builder
Builder node that accumulates real numbers (double).
Definition: Complex128Builder.h:17
awkward::Complex128Builder::Complex128Builder
Complex128Builder(const BuilderOptions &options, GrowableBuffer< std::complex< double > > buffer)
Create a Complex128Builder from a full set of parameters.
awkward::Complex128Builder::real
const BuilderPtr real(double x) override
Adds a real value x to the accumulated data.
awkward::Complex128Builder::endlist
const BuilderPtr endlist() override
Ends a nested list.
awkward::Complex128Builder::fromempty
static const BuilderPtr fromempty(const BuilderOptions &options)
Create an empty Complex128Builder.
awkward::Complex128Builder::timedelta
const BuilderPtr timedelta(int64_t x, const std::string &unit) override
Adds a timedelta value x to the accumulated data.
awkward::Complex128Builder::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::Complex128Builder::complex
const BuilderPtr complex(std::complex< double > x) override
Adds a complex value x to the accumulated data.
awkward::Complex128Builder::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::Complex128Builder::length
int64_t length() const override
Current length of the accumulated array.
awkward::Complex128Builder::endrecord
const BuilderPtr endrecord() override
Ends a record.
awkward::Complex128Builder::fromint64
static const BuilderPtr fromint64(const BuilderOptions &options, const GrowableBuffer< int64_t > &old)
Create a Complex128Builder from an existing Int64Builder.
awkward::Complex128Builder::active
bool active() const override
If true, this node has started but has not finished a multi-step command (e.g. beginX ....
awkward::Complex128Builder::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::Complex128Builder::options
const BuilderOptions & options() const
Definition: Complex128Builder.h:117
awkward::Complex128Builder::integer
const BuilderPtr integer(int64_t x) override
Adds an integer value x to the accumulated data.
awkward::Complex128Builder::buffer
const GrowableBuffer< std::complex< double > > & buffer() const
Definition: Complex128Builder.h:119
awkward::Complex128Builder::datetime
const BuilderPtr datetime(int64_t x, const std::string &unit) override
Adds a datetime value x to the accumulated data.
awkward::Complex128Builder::beginrecord
const BuilderPtr beginrecord(const char *name, bool check) override
Begins building a record with an optional name.
awkward::Complex128Builder::null
const BuilderPtr null() override
Adds a null value to the accumulated data.
awkward::Complex128Builder::fromfloat64
static const BuilderPtr fromfloat64(const BuilderOptions &options, const GrowableBuffer< double > &old)
Create a Complex128Builder from an existing Float64Builder.
awkward::Complex128Builder::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::Complex128Builder::beginlist
const BuilderPtr beginlist() override
Begins building a nested list.
awkward::Complex128Builder::boolean
const BuilderPtr boolean(bool x) override
Adds a boolean value x to the accumulated data.
awkward::Complex128Builder::begintuple
const BuilderPtr begintuple(int64_t numfields) override
Begins building a tuple with a fixed number of fields.
awkward::Complex128Builder::endtuple
const BuilderPtr endtuple() override
Ends a tuple.
awkward::Complex128Builder::classname
const std::string classname() const override
User-friendly name of this class: "Complex128Builder".
awkward::Complex128Builder::clear
void clear() override
Removes all accumulated data without resetting the type knowledge.
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