Alexandria  2.25.0
SDC-CH common library for the Euclid project
Public Member Functions | Private Attributes | List of all members
Euclid::NdArray::MappedContainer< T > Class Template Reference

#include <NpyCommon.h>

Collaboration diagram for Euclid::NdArray::MappedContainer< T >:
Collaboration graph
[legend]

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
 
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.

Member Function Documentation

◆ data()

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

Definition at line 255 of file NpyCommon.h.

References Euclid::NdArray::MappedContainer< T >::m_data.

◆ 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 Euclid::NdArray::MappedContainer< T >::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 284 of file NpyCommon.h.

Referenced by Euclid::NdArray::MappedContainer< T >::resize().

◆ m_data

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

Definition at line 286 of file NpyCommon.h.

Referenced by Euclid::NdArray::MappedContainer< T >::data().

◆ m_data_offset

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

Definition at line 283 of file NpyCommon.h.

Referenced by Euclid::NdArray::MappedContainer< T >::resize().

◆ m_mapped

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

Definition at line 285 of file NpyCommon.h.

Referenced by Euclid::NdArray::MappedContainer< T >::resize().

◆ m_max_size

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

Definition at line 283 of file NpyCommon.h.

Referenced by Euclid::NdArray::MappedContainer< T >::resize().

◆ m_n_elements

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

◆ m_path

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

Definition at line 282 of file NpyCommon.h.

Referenced by Euclid::NdArray::MappedContainer< T >::resize().


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