Blender  V3.3
Public Member Functions | Protected Attributes | List of all members
blender::GSpan Class Reference

#include <BLI_generic_span.hh>

Inheritance diagram for blender::GSpan:
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
 
const voiddata () const
 
const voidoperator[] (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
 

Protected Attributes

const CPPTypetype_ = nullptr
 
const voiddata_ = 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 17 of file BLI_generic_span.hh.

Constructor & Destructor Documentation

◆ GSpan() [1/6]

blender::GSpan::GSpan ( )
default

Referenced by slice().

◆ GSpan() [2/6]

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

◆ GSpan() [3/6]

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

Definition at line 35 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 43 of file BLI_generic_span.hh.

◆ GSpan() [6/6]

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

Definition at line 48 of file BLI_generic_span.hh.

Member Function Documentation

◆ data()

const void* blender::GSpan::data ( ) const
inline

Definition at line 74 of file BLI_generic_span.hh.

References data_.

Referenced by blender::GMutableSpan::copy_from(), and blender::GVArray::GVArray().

◆ is_empty()

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

Definition at line 64 of file BLI_generic_span.hh.

References size_.

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

◆ operator[]()

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

Definition at line 79 of file BLI_generic_span.hh.

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

◆ size()

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

◆ slice() [1/2]

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

◆ slice() [2/2]

GSpan blender::GSpan::slice ( const int64_t  start,
int64_t  size 
) const
inline

◆ type()

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

◆ type_ptr()

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

Definition at line 59 of file BLI_generic_span.hh.

References type_.

◆ typed()

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

Member Data Documentation

◆ data_

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

Definition at line 20 of file BLI_generic_span.hh.

Referenced by data(), blender::GVArraySpan::GVArraySpan(), operator[](), slice(), and typed().

◆ size_

int64_t blender::GSpan::size_ = 0
protected

◆ type_

const CPPType* blender::GSpan::type_ = nullptr
protected

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