Alexandria 2.31.4
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Euclid::NdArray::MappedContainer< T > Class Template Reference

#include <NpyCommon.h>

Collaboration diagram for Euclid::NdArray::MappedContainer< T >:

Public Member Functions

 MappedContainer (const boost::filesystem::path &path, size_t data_offset, size_t n_elements, const std::vector< std::string > &attr_names, boost::iostreams::mapped_file &&input, size_t max_size)
size_t size () const
size_t nbytes () const
T * data ()
void resize (const std::vector< size_t > &shape)

Private Attributes

boost::filesystem::path m_path
size_t m_data_offset
size_t m_n_elements
size_t m_max_size
std::vector< std::stringm_attr_names
boost::iostreams::mapped_file m_mapped
T * m_data

Detailed Description

template<typename T>
class Euclid::NdArray::MappedContainer< T >

A memory mapped container that can be used by NdArray. Builds on top of boost::iostream::mapped_file

Template Parameters
TContained value type

Definition at line 239 of file NpyCommon.h.

Constructor & Destructor Documentation

◆ MappedContainer()

template<typename T>
Euclid::NdArray::MappedContainer< T >::MappedContainer ( const boost::filesystem::path & path,
size_t data_offset,
size_t n_elements,
const std::vector< std::string > & attr_names,
boost::iostreams::mapped_file && input,
size_t max_size )
inline

Definition at line 241 of file NpyCommon.h.

References m_attr_names, m_data, m_data_offset, m_mapped, m_max_size, m_n_elements, and m_path.

Member Function Documentation

◆ data()

template<typename T>
T * Euclid::NdArray::MappedContainer< T >::data ( )
inline

Definition at line 259 of file NpyCommon.h.

References m_data.

◆ nbytes()

template<typename T>
size_t Euclid::NdArray::MappedContainer< T >::nbytes ( ) const
inline

Definition at line 255 of file NpyCommon.h.

References m_max_size.

◆ resize()

template<typename T>
void Euclid::NdArray::MappedContainer< T >::resize ( const std::vector< size_t > & shape)
inline

◆ size()

template<typename T>
size_t Euclid::NdArray::MappedContainer< T >::size ( ) const
inline

Definition at line 251 of file NpyCommon.h.

References m_n_elements.

Member Data Documentation

◆ m_attr_names

template<typename T>
std::vector<std::string> Euclid::NdArray::MappedContainer< T >::m_attr_names
private

Definition at line 288 of file NpyCommon.h.

Referenced by MappedContainer(), and resize().

◆ m_data

template<typename T>
T* Euclid::NdArray::MappedContainer< T >::m_data
private

Definition at line 290 of file NpyCommon.h.

Referenced by data(), and MappedContainer().

◆ m_data_offset

template<typename T>
size_t Euclid::NdArray::MappedContainer< T >::m_data_offset
private

Definition at line 287 of file NpyCommon.h.

Referenced by MappedContainer(), and resize().

◆ m_mapped

template<typename T>
boost::iostreams::mapped_file Euclid::NdArray::MappedContainer< T >::m_mapped
private

Definition at line 289 of file NpyCommon.h.

Referenced by MappedContainer(), and resize().

◆ m_max_size

template<typename T>
size_t Euclid::NdArray::MappedContainer< T >::m_max_size
private

Definition at line 287 of file NpyCommon.h.

Referenced by MappedContainer(), nbytes(), and resize().

◆ m_n_elements

template<typename T>
size_t Euclid::NdArray::MappedContainer< T >::m_n_elements
private

Definition at line 287 of file NpyCommon.h.

Referenced by MappedContainer(), resize(), and size().

◆ m_path

template<typename T>
boost::filesystem::path Euclid::NdArray::MappedContainer< T >::m_path
private

Definition at line 286 of file NpyCommon.h.

Referenced by MappedContainer(), and resize().


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