Blender V4.3
blender::GSpan Class Reference

#include <BLI_generic_span.hh>

Inherited by blender::GVArraySpan.

Public Member Functions

 GSpan ()=default
 
 GSpan (const CPPType *type, const void *buffer, int64_t size)
 
 GSpan (const CPPType &type, const void *buffer, int64_t size)
 
 GSpan (const CPPType &type)
 
 GSpan (const CPPType *type)
 
template<typename T >
 GSpan (Span< T > array)
 
const CPPTypetype () const
 
const CPPTypetype_ptr () const
 
bool is_empty () const
 
int64_t size () const
 
int64_t size_in_bytes () const
 
const void * data () const
 
const void * operator[] (int64_t index) const
 
template<typename T >
Span< Ttyped () const
 
GSpan slice (const int64_t start, int64_t size) const
 
GSpan slice (const IndexRange range) const
 
GSpan drop_front (const int64_t n) const
 
GSpan drop_back (const int64_t n) const
 
GSpan take_front (const int64_t n) const
 
GSpan take_back (const int64_t n) const
 

Protected Attributes

const CPPTypetype_ = nullptr
 
const void * data_ = nullptr
 
int64_t size_ = 0
 

Detailed Description

A generic span. It behaves just like a blender::Span<T>, but the type is only known at run-time.

Definition at line 19 of file BLI_generic_span.hh.

Constructor & Destructor Documentation

◆ GSpan() [1/6]

blender::GSpan::GSpan ( )
default

◆ GSpan() [2/6]

blender::GSpan::GSpan ( const CPPType * type,
const void * buffer,
int64_t size )
inline

Definition at line 28 of file BLI_generic_span.hh.

References BLI_assert.

◆ GSpan() [3/6]

blender::GSpan::GSpan ( const CPPType & type,
const void * buffer,
int64_t size )
inline

Definition at line 37 of file BLI_generic_span.hh.

◆ GSpan() [4/6]

blender::GSpan::GSpan ( const CPPType & type)
inline

Definition at line 39 of file BLI_generic_span.hh.

◆ GSpan() [5/6]

blender::GSpan::GSpan ( const CPPType * type)
inline

Definition at line 41 of file BLI_generic_span.hh.

◆ GSpan() [6/6]

template<typename T >
blender::GSpan::GSpan ( Span< T > array)
inline

Definition at line 44 of file BLI_generic_span.hh.

Member Function Documentation

◆ data()

◆ drop_back()

GSpan blender::GSpan::drop_back ( const int64_t n) const
inline

Definition at line 113 of file BLI_generic_span.hh.

References BLI_assert, data_, GSpan(), size_, and type_.

◆ drop_front()

GSpan blender::GSpan::drop_front ( const int64_t n) const
inline

◆ is_empty()

bool blender::GSpan::is_empty ( ) const
inline

Definition at line 60 of file BLI_generic_span.hh.

References size_.

Referenced by blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().

◆ operator[]()

const void * blender::GSpan::operator[] ( int64_t index) const
inline

Definition at line 80 of file BLI_generic_span.hh.

References BLI_assert, data_, POINTER_OFFSET, blender::CPPType::size(), size_, and type_.

◆ size()

◆ size_in_bytes()

int64_t blender::GSpan::size_in_bytes ( ) const
inline

Definition at line 70 of file BLI_generic_span.hh.

References blender::CPPType::size(), size_, and type_.

◆ slice() [1/2]

GSpan blender::GSpan::slice ( const IndexRange range) const
inline

Definition at line 101 of file BLI_generic_span.hh.

References slice(), and blender::IndexRange::start().

◆ slice() [2/2]

◆ take_back()

GSpan blender::GSpan::take_back ( const int64_t n) const
inline

◆ take_front()

GSpan blender::GSpan::take_front ( const int64_t n) const
inline

Definition at line 120 of file BLI_generic_span.hh.

References BLI_assert, data_, GSpan(), size_, and type_.

◆ type()

◆ type_ptr()

const CPPType * blender::GSpan::type_ptr ( ) const
inline

Definition at line 55 of file BLI_generic_span.hh.

References type_.

◆ typed()

Member Data Documentation

◆ data_

const void* blender::GSpan::data_ = nullptr
protected

◆ size_

◆ type_


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