spla
Public Member Functions | Static Public Member Functions | List of all members
spla::MemView Class Referencefinal

View to some memory resource without life-time control. More...

#include <memview.hpp>

Inheritance diagram for spla::MemView:
Inheritance graph
[legend]
Collaboration diagram for spla::MemView:
Collaboration graph
[legend]

Public Member Functions

 ~MemView () override=default
 
Status read (std::size_t offset, std::size_t size, void *dst)
 
Status write (std::size_t offset, std::size_t size, const void *src)
 
void * get_buffer () const
 
std::size_t get_size () const
 
bool is_mutable () const
 
- Public Member Functions inherited from spla::RefCnt
virtual ~RefCnt ()
 
bool is_unique () const
 
std::int32_t get_refs () const
 
std::int32_t add_ref () const
 
std::int32_t rel_ref () const
 

Static Public Member Functions

static ref_ptr< MemViewmake (void *buffer, std::size_t size, bool is_mutable=false)
 
static ref_ptr< MemViewmake ()
 

Detailed Description

View to some memory resource without life-time control.

Memory view allows to inspect raw structure of a particular buffer without explicit control over life time of without costly copy operation to move data from one place into another. Use views to access data and then to copy values or fill values from your own data source.

Note
Memory view does not control type and layout of data. Thus, be cautions when modifying data through the view.

Constructor & Destructor Documentation

◆ ~MemView()

spla::MemView::~MemView ( )
overridedefault

Member Function Documentation

◆ get_buffer()

void * spla::MemView::get_buffer ( ) const

◆ get_size()

std::size_t spla::MemView::get_size ( ) const

◆ is_mutable()

bool spla::MemView::is_mutable ( ) const

◆ make() [1/2]

ref_ptr< MemView > spla::MemView::make ( )
static

◆ make() [2/2]

ref_ptr< MemView > spla::MemView::make ( void *  buffer,
std::size_t  size,
bool  is_mutable = false 
)
static

◆ read()

Status spla::MemView::read ( std::size_t  offset,
std::size_t  size,
void *  dst 
)

◆ write()

Status spla::MemView::write ( std::size_t  offset,
std::size_t  size,
const void *  src 
)

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