MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::IO::CompositeReader Class Referenceabstract

Typed FileReader boundary for schema-bearing Composite data. More...

#include <CompositeReader.hpp>

+ Inheritance diagram for MayaFlux::IO::CompositeReader:
+ Collaboration diagram for MayaFlux::IO::CompositeReader:

Public Member Functions

std::shared_ptr< Kakshya::CompositeContainer > create_composite_container (size_t batch_size=1)
 Read remaining elements into a new CompositeContainer.
 
std::shared_ptr< Kakshya::SignalSourceContainer > create_container () override
 CompositeContainer is not a SignalSourceContainer.
 
std::type_index get_container_type () const override
 Get the container type this reader creates.
 
std::type_index get_data_type () const override
 Get the data type this reader produces.
 
std::string get_last_error () const override
 Get the last error message.
 
virtual std::optional< Kakshya::CompositeLayout > get_layout () const =0
 Inspect the schema established by open() without reading data.
 
bool load_into_container (std::shared_ptr< Kakshya::SignalSourceContainer >) override
 CompositeContainer is not a SignalSourceContainer.
 
std::vector< Kakshya::DataVariant > read_all () override
 Composite data is not a DataVariant channel vector.
 
virtual std::optional< Kakshya::CompositeArray > read_composite ()=0
 Read all remaining elements into one owning array.
 
std::optional< Kakshya::CompositeArray > read_composite_region (const FileRegion &region)
 Read an inclusive one-dimensional file region.
 
virtual std::optional< Kakshya::CompositeArray > read_next (size_t max_elements)=0
 Read at most max_elements from the current file position.
 
std::vector< Kakshya::DataVariant > read_region (const FileRegion &) override
 Use read_composite_region() for a schema-bearing result.
 
 ~CompositeReader () override=default
 
- Public Member Functions inherited from MayaFlux::IO::FileReader
virtual bool can_read (const std::string &filepath) const =0
 Check if a file can be read by this reader.
 
virtual void close ()=0
 Close the currently open file.
 
virtual std::vector< uint64_t > get_dimension_sizes () const =0
 Get size of each dimension in the file data.
 
virtual std::optional< FileMetadata > get_metadata () const =0
 Get metadata from the open file.
 
virtual size_t get_num_dimensions () const =0
 Get the dimensionality of the file data.
 
virtual uint64_t get_preferred_chunk_size () const =0
 Get the preferred chunk size for streaming.
 
virtual std::vector< uint64_t > get_read_position () const =0
 Get current read position in primary dimension.
 
virtual std::vector< FileRegion > get_regions () const =0
 Get semantic regions from the file.
 
virtual std::vector< std::string > get_supported_extensions () const =0
 Get supported file extensions for this reader.
 
virtual bool is_open () const =0
 Check if a file is currently open.
 
virtual bool open (const std::string &filepath, FileReadOptions options=FileReadOptions::ALL)=0
 Open a file for reading.
 
virtual bool seek (const std::vector< uint64_t > &position)=0
 Seek to a specific position in the file.
 
virtual bool supports_streaming () const =0
 Check if streaming is supported for the current file.
 
virtual ~FileReader ()=default
 

Protected Attributes

std::string m_last_error
 

Additional Inherited Members

- Static Public Member Functions inherited from MayaFlux::IO::FileReader
static std::string resolve_path (const std::string &filepath)
 Resolve a filepath against the project source root if not found as-is.
 
- Static Protected Member Functions inherited from MayaFlux::IO::FileReader
static std::unordered_map< std::string, Kakshya::RegionGroup > regions_to_groups (const std::vector< FileRegion > &regions)
 Convert file regions to region groups.
 

Detailed Description

Typed FileReader boundary for schema-bearing Composite data.

Concrete readers return CompositeArray values without flattening their layout or text storage into unrelated DataVariant channels. The inherited DataVariant and SignalSourceContainer result methods are unsupported. get_layout() exposes the schema a concrete reader established on open(), so a caller can inspect field names and types before reading any data.

Usage:

std::unique_ptr<CompositeReader> reader =
std::make_unique<DelimitedTextReader>();
if (reader->open("measurements.csv")) {
auto first = reader->read_next(1024);
auto remaining = reader->read_composite();
}
Note
read_composite() reads from the current position. Call seek({0}) first to read the complete file after earlier bounded reads.

Definition at line 35 of file CompositeReader.hpp.


The documentation for this class was generated from the following files: