MCPcopy Create free account
hub / github.com/apache/arrow / IntFromFlatbuffer

Function IntFromFlatbuffer

cpp/src/arrow/ipc/metadata_internal.cc:119–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117namespace {
118
119Status IntFromFlatbuffer(const flatbuf::Int* int_data, std::shared_ptr<DataType>* out) {
120 if (int_data->bitWidth() > 64) {
121 return Status::NotImplemented("Integers with more than 64 bits not implemented");
122 }
123 if (int_data->bitWidth() < 8) {
124 return Status::NotImplemented("Integers with less than 8 bits not implemented");
125 }
126
127 switch (int_data->bitWidth()) {
128 case 8:
129 *out = int_data->is_signed() ? int8() : uint8();
130 break;
131 case 16:
132 *out = int_data->is_signed() ? int16() : uint16();
133 break;
134 case 32:
135 *out = int_data->is_signed() ? int32() : uint32();
136 break;
137 case 64:
138 *out = int_data->is_signed() ? int64() : uint64();
139 break;
140 default:
141 return Status::NotImplemented("Integers not in cstdint are not implemented");
142 }
143 return Status::OK();
144}
145
146Status FloatFromFlatbuffer(const flatbuf::FloatingPoint* float_data,
147 std::shared_ptr<DataType>* out) {

Callers 5

FieldFromFlatbufferFunction · 0.85

Calls 3

NotImplementedFunction · 0.50
OKFunction · 0.50
is_signedMethod · 0.45

Tested by

no test coverage detected