cgv
Loading...
Searching...
No Matches
cgv::data::const_data_view Class Reference

The const_data_view has the functionality of the data_view but uses a const pointer and therefore does not allow to manage the pointer nor to set the data. More...

#include <data_view.h>

Inheritance diagram for cgv::data::const_data_view:
cgv::data::data_view_impl< const_data_view, const unsigned char * > cgv::data::data_view_base

Public Member Functions

 const_data_view ()
 construct an empty data view without format and with empty data pointer*‍/
 const_data_view (const data_view &dv)
 copy construct from a non const data view
 const_data_view (const data_format *_format, const void *_data_ptr)
 construct a data view from the given format, viewing the complete data set pointed to by the passed data pointer
const_data_view & operator= (const const_data_view &dv)
 assignment of const_data_view never gains ownership of format or data
void set_ptr (const void *ptr)
 set a different data pointer
Public Member Functions inherited from cgv::data::data_view_impl< const_data_view, const unsigned char * >
bool empty () const
 return whether the data pointer is a null pointer
cgv::type::func::transfer_const< const unsigned char *, S * >::type get_ptr () const
 return a data pointer to type S
S get (unsigned ci) const
 constant access to the ci-th component
const_data_view operator() (size_t i) const
 access to i-th data entry
const_data_view permute (const std::string &permutation) const
 permute the order of the indices, where the permutation argument "kji" implies that after the permutation the operator (i,j,k) returns the same as the operator (k,j,i) before the call to permute.
const_data_view transpose () const
 transpose is equivalent to permute("ji")
cgv::type::func::transfer_const< const unsigned char *, S * >::type step_i (S *ptr, std::ptrdiff_t n=1) const
 return a pointer that points to the n-th next location if index i is increase by n
cgv::type::func::transfer_const< const unsigned char *, S * >::type step_j (S *ptr, std::ptrdiff_t n=1) const
 return a pointer that points to the n-th next location if index j is increase by n
cgv::type::func::transfer_const< const unsigned char *, S * >::type step_k (S *ptr, std::ptrdiff_t n=1) const
 return a pointer that points to the n-th next location if index k is increase by n
cgv::type::func::transfer_const< const unsigned char *, S * >::type step_l (S *ptr, std::ptrdiff_t n=1) const
 return a pointer that points to the n-th next location if index l is increase by n
Public Member Functions inherited from cgv::data::data_view_base
 data_view_base (const data_format *_format=0)
 construct the base of a data view from the given format, such that the step sizes and dimension are set to view the complete data set defined in the format.
virtual ~data_view_base ()
 delete format if it is owned
void manage_format (bool enable=true)
 whether to manage the data format pointer
const data_format * get_format () const
 return the component format
void set_format (const data_format *_format)
 set a new data format
unsigned int get_dim () const
 return the dimension of the data view, which is less or equal to the dimension of the data format
size_t get_step_size (unsigned int dim) const
 return the step size in bytes in the i-th dimension

Protected Member Functions

 const_data_view (const data_format *_format, const unsigned char *_data_ptr, unsigned _dim, const size_t *_step_sizes)
 use base class for construction
Protected Member Functions inherited from cgv::data::data_view_impl< const_data_view, const unsigned char * >
 data_view_impl (const data_format *_format, const unsigned char *_data_ptr, unsigned _dim, const size_t *_step_sizes)
 constructor used to construct sub views onto the data view
Protected Member Functions inherited from cgv::data::data_view_base
 data_view_base (const data_format *_format, unsigned int _dim, const size_t *_step_sizes)
 constructor used to construct sub views onto the data view

Friends

class data_view_impl< const_data_view, const unsigned char * >
 declare base as friend

Additional Inherited Members

Protected Attributes inherited from cgv::data::data_view_impl< const_data_view, const unsigned char * >
const unsigned char * data_ptr
 data pointer of type unsigned char or const unsigned char
Protected Attributes inherited from cgv::data::data_view_base
const data_format * format
bool owns_format
 whether to own the data format
unsigned int dim
size_t step_sizes [4]

Detailed Description

The const_data_view has the functionality of the data_view but uses a const pointer and therefore does not allow to manage the pointer nor to set the data.

Definition at line 220 of file data_view.h.

Constructor & Destructor Documentation

◆ const_data_view() [1/4]

cgv::data::const_data_view::const_data_view ( const data_format * _format,
const unsigned char * _data_ptr,
unsigned _dim,
const size_t * _step_sizes )
protected

◆ const_data_view() [2/4]

cgv::data::const_data_view::const_data_view ( )

construct an empty data view without format and with empty data pointer*‍/

Definition at line 261 of file data_view.cxx.

◆ const_data_view() [3/4]

◆ const_data_view() [4/4]

cgv::data::const_data_view::const_data_view ( const data_format * _format,
const void * _data_ptr )

construct a data view from the given format, viewing the complete data set pointed to by the passed data pointer

Definition at line 264 of file data_view.cxx.

References const_data_view(), and cgv::data::data_view_impl< const_data_view, const unsigned char * >::data_view_impl().

Member Function Documentation

◆ operator=()

const_data_view & cgv::data::const_data_view::operator= ( const const_data_view & dv)

◆ set_ptr()

void cgv::data::const_data_view::set_ptr ( const void * ptr)

set a different data pointer

Definition at line 273 of file data_view.cxx.

References cgv::data::data_view_impl< const_data_view, const unsigned char * >::data_ptr.

◆ data_view_impl< const_data_view, const unsigned char * >

friend class data_view_impl< const_data_view, const unsigned char * >
friend

declare base as friend

Definition at line 213 of file data_view.h.


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