src/IO/core/DataLoader.hpp
src/IO/core/DataLoader.hpp
Classes
| Name | |
|---|---|
| struct | LoadResult Result of a data loading operation. |
| class | DataLoader Abstract base class for data loaders. |
Types
| Name | |
|---|---|
| using std::variant< std::shared_ptr< LineData >, std::shared_ptr< PointData >, std::shared_ptr< MaskData >, std::shared_ptr< ImageData >, std::shared_ptr< AnalogTimeSeries >, std::shared_ptr< DigitalEventSeries >, std::shared_ptr< DigitalIntervalSeries >, std::shared_ptr< TensorData >, std::shared_ptr< TimeFrame > > | LoadedDataVariant Variant type for all possible data types that can be loaded. |
Types Documentation
using LoadedDataVariant
using LoadedDataVariant = std::variant<
std::shared_ptr<LineData>,
std::shared_ptr<PointData>,
std::shared_ptr<MaskData>,
std::shared_ptr<ImageData>,
std::shared_ptr<AnalogTimeSeries>,
std::shared_ptr<DigitalEventSeries>,
std::shared_ptr<DigitalIntervalSeries>,
std::shared_ptr<TensorData>,
std::shared_ptr<TimeFrame>>;Variant type for all possible data types that can be loaded.
Source code
#ifndef DATAMANAGER_IO_DATALOADER_HPP
#define DATAMANAGER_IO_DATALOADER_HPP
#include "DataTypeEnum/DM_DataType.hpp"
#include "nlohmann/json.hpp"
#include <memory>
#include <string>
#include <variant>
class LineData;
class PointData;
class MaskData;
class ImageData;
class AnalogTimeSeries;
class DigitalEventSeries;
class DigitalIntervalSeries;
class TensorData;
class TimeFrame;
using LoadedDataVariant = std::variant<
std::shared_ptr<LineData>,
std::shared_ptr<PointData>,
std::shared_ptr<MaskData>,
std::shared_ptr<ImageData>,
std::shared_ptr<AnalogTimeSeries>,
std::shared_ptr<DigitalEventSeries>,
std::shared_ptr<DigitalIntervalSeries>,
std::shared_ptr<TensorData>,
std::shared_ptr<TimeFrame>>;
struct LoadResult {
bool success = false;
std::string error_message;
LoadedDataVariant data;
std::string name;
LoadResult() = default;
LoadResult(LoadedDataVariant && loaded_data)
: success(true),
data(std::move(loaded_data)) {}
LoadResult(LoadedDataVariant && loaded_data, std::string const & result_name)
: success(true),
data(std::move(loaded_data)),
name(result_name) {}
LoadResult(std::string const & error)
: success(false),
error_message(error) {}
};
class DataLoader {
public:
virtual ~DataLoader() = default;
virtual std::string getFormatId() const = 0;
virtual bool supportsDataType(DM_DataType data_type) const = 0;
virtual LoadResult loadData(
std::string const & file_path,
DM_DataType data_type,
nlohmann::json const & config) const = 0;
};
#endif// DATAMANAGER_IO_DATALOADER_HPPUpdated on 2026-11-13 at 20:25:43 +0000