17 #include <cerata/api.h>
18 #include <fletcher/common.h>
24 #include "fletchgen/basic_types.h"
28 using cerata::Component;
29 using cerata::Instance;
31 using cerata::Literal;
34 PARAM_DECL_FACTORY(index_width, 32)
35 PARAM_DECL_FACTORY(tag_width, 1)
45 std::shared_ptr<Type>
cmd_type(const std::shared_ptr<Node> &index_width,
46 const std::shared_ptr<Node> &tag_width,
47 const std::optional<std::shared_ptr<Node>> &ctrl_width = std::nullopt);
49 std::shared_ptr<Type>
unlock_type(const std::shared_ptr<Node> &tag_width);
52 std::shared_ptr<Type>
array_reader_out(uint32_t num_streams = 0, uint32_t full_width = 0);
57 std::shared_ptr<Type>
array_writer_in(uint32_t num_streams = 0, uint32_t full_width = 0);
59 std::shared_ptr<Type>
array_writer_in(std::pair<uint32_t, uint32_t> spec);
76 std::shared_ptr<Node>
GetWidthNode(
const arrow::DataType &type);
110 std::shared_ptr<Type>
GetStreamType(
const arrow::Field &arrow_field, fletcher::Mode mode,
int level = 0);
117 std::pair<uint32_t, uint32_t>
GetArrayDataSpec(
const arrow::Field &arrow_field);
124 Component *
array(fletcher::Mode mode);
Contains all classes and functions related to Fletchgen.
std::shared_ptr< Type > cmd_type(const std::shared_ptr< Node > &index_width, const std::shared_ptr< Node > &tag_width, const std::optional< std::shared_ptr< Node >> &ctrl_width)
Return a Fletcher command stream type.
std::shared_ptr< TypeMapper > GetStreamTypeMapper(Type *stream_type, Type *other)
Get a type mapper for an Arrow::Field-based stream to an ArrayReader/Writer stream.
std::string GenerateConfigString(const arrow::Field &field, int level)
Return the configuration string for a ArrayReader/Writer.
std::shared_ptr< Node > GetWidthNode(const arrow::DataType &type)
Return a node representing the width of a (flat) Arrow DataType.
std::pair< uint32_t, uint32_t > GetArrayDataSpec(const arrow::Field &arrow_field)
Get the ArrayR/W number of streams and data width from an Arrow Field.
std::shared_ptr< Type > unlock_type(const std::shared_ptr< Node > &tag_width)
Fletcher unlock stream.
std::shared_ptr< Type > GetStreamType(const arrow::Field &arrow_field, fletcher::Mode mode, int level)
Convert an Arrow::Field into a stream type.
uint32_t GetTagWidth(const arrow::Field &field)
Return the tag width of this field as a literal node. Settable through Arrow metadata....
ConfigType
Types for ArrayReader/Writer configuration string.
@ LIST
Variable length fields.
@ PRIM
Primitive (fixed-width) fields.
@ LIST_PRIM
List of primitives. Can have EPC > 1.
@ STRUCT
Structs, composed of multiple fields.
std::shared_ptr< Type > array_writer_in(uint32_t num_streams, uint32_t full_width)
Fletcher write data.
size_t GetCtrlBufferCount(const arrow::Field &field)
Return the number of buffers for the control field.
Component * array(Mode mode)
Return a Cerata component model of an Array(Reader/Writer).
ConfigType GetConfigType(const arrow::DataType &type)
Return the configuration string type version of an arrow::DataType.
std::shared_ptr< Type > array_reader_out(uint32_t num_streams, uint32_t full_width)
Fletcher read data.