Skip to main content

src/DataObjects/AnalogTimeSeries/storage/AnalogDataStorageCache.hpp

src/DataObjects/AnalogTimeSeries/storage/AnalogDataStorageCache.hpp

Cache structure and storage type enum for analog data storage backends.

Classes

Name
struct AnalogDataStorageCache
Cache structure for fast-path access to contiguous analog storage.

Types

Name
enum class AnalogStorageType { Vector, MemoryMapped, View, LazyView, Custom}
Storage type enumeration for runtime type identification.

Types Documentation

enum AnalogStorageType

Enumerator Value Description
Vector Contiguous in-memory vector storage.
MemoryMapped Memory-mapped file storage.
View View-based storage referencing another series.
LazyView Lazy view-based storage (computed on demand).
Custom Custom user-defined storage type.

Storage type enumeration for runtime type identification.

Source code



#ifndef ANALOG_DATA_STORAGE_CACHE_HPP
#define ANALOG_DATA_STORAGE_CACHE_HPP

#include <cstddef> // size_t

enum class AnalogStorageType {
    Vector,     
    MemoryMapped,
    View,       
    LazyView,   
    Custom      
};

struct AnalogDataStorageCache {
    float const * data_ptr = nullptr;
    std::size_t cache_size = 0;
    bool is_contiguous = false;

    [[nodiscard]] constexpr bool isValid() const noexcept {
        return is_contiguous && data_ptr != nullptr && cache_size > 0;
    }

    [[nodiscard]] float const & getValue(std::size_t idx) const noexcept {
        return data_ptr[idx];
    }
};

#endif// ANALOG_DATA_STORAGE_CACHE_HPP

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