Skip to main content

BinaryFormatLoader

BinaryFormatLoader

Format-centric binary loader for all binary file data types. More…

#include <BinaryFormatLoader.hpp>

Inherits from IFormatLoader

Public Functions

Name
BinaryFormatLoader() =default
~BinaryFormatLoader() override =default
virtual LoadResult load(std::string const & filepath, DM_DataType dataType, nlohmann::json const & config) const override
Load a single data object from binary file.
virtual bool supportsBatchLoading(std::string const & format, DM_DataType dataType) const override
Check if batch loading is supported for this format/type.
virtual BatchLoadResult loadBatch(std::string const & filepath, DM_DataType dataType, nlohmann::json const & config) const override
Load all data objects from a multi-channel binary file.
virtual LoadResult save(std::string const & filepath, DM_DataType dataType, nlohmann::json const & config, void const * data) const override
Save is not supported for binary format.
virtual bool supportsFormat(std::string const & format, DM_DataType dataType) const override
Check if this loader supports the format/dataType combination.
virtual std::string getLoaderName() const override
Get loader name for logging.

Additional inherited members

Public Functions inherited from IFormatLoader

Name
virtual ~IFormatLoader() =default
virtual std::vector< SaverInfo > getSaverInfo() const
Return metadata for all save operations this loader supports.
virtual std::vector< LoaderInfo > getLoaderInfo() const
Return metadata for all load operations this loader supports.

Detailed Description

class BinaryFormatLoader;

Format-centric binary loader for all binary file data types.

This loader follows the format-centric architecture where one loader handles a specific file format (binary) for all applicable data types.

Supported data types:

This loader supports batch loading for multi-channel binary files, returning all channels in a single loadBatch() call.

Configuration options vary by data type - see individual load methods for required and optional JSON configuration fields.

Public Functions Documentation

function BinaryFormatLoader

BinaryFormatLoader() =default

function ~BinaryFormatLoader

~BinaryFormatLoader() override =default

function load

virtual LoadResult load(
    std::string const & filepath,
    DM_DataType dataType,
    nlohmann::json const & config
) const override

Load a single data object from binary file.

Reimplements: IFormatLoader::load

For multi-channel binary files (Analog with num_channels > 1), this returns only the first channel. Use loadBatch() for all channels.

function supportsBatchLoading

virtual bool supportsBatchLoading(
    std::string const & format,
    DM_DataType dataType
) const override

Check if batch loading is supported for this format/type.

Reimplements: IFormatLoader::supportsBatchLoading

Returns true for:

  • Analog binary with num_channels > 1
  • DigitalEvent (potentially multiple TTL channels)
  • DigitalInterval (potentially multiple TTL channels)

function loadBatch

virtual BatchLoadResult loadBatch(
    std::string const & filepath,
    DM_DataType dataType,
    nlohmann::json const & config
) const override

Load all data objects from a multi-channel binary file.

Reimplements: IFormatLoader::loadBatch

For Analog data type, returns one AnalogTimeSeries per channel. For Digital types, currently returns single object (future: multiple TTL channels).

function save

virtual LoadResult save(
    std::string const & filepath,
    DM_DataType dataType,
    nlohmann::json const & config,
    void const * data
) const override

Save is not supported for binary format.

Reimplements: IFormatLoader::save

function supportsFormat

virtual bool supportsFormat(
    std::string const & format,
    DM_DataType dataType
) const override

Check if this loader supports the format/dataType combination.

Reimplements: IFormatLoader::supportsFormat

Supports format “binary” for Analog, DigitalEvent, DigitalInterval Supports format “uint16” for DigitalEvent, DigitalInterval (legacy compatibility)

function getLoaderName

virtual std::string getLoaderName() const override

Get loader name for logging.

Reimplements: IFormatLoader::getLoaderName


Updated on 2026-11-13 at 20:25:41 +0000