ScummVM API documentation
Common::SpanBase< ValueType, Derived > Class Template Reference
Inheritance diagram for Common::SpanBase< ValueType, Derived >:
Common::SafeBool< Derived< ValueType > > Common::impl::no_base< Derived< ValueType > > Common::SpanImpl< ValueType, Derived > Common::NamedSpanImpl< ValueType, Derived > Dgds::SciSpanImpl< ValueType, Derived > Sci::SciSpanImpl< ValueType, Derived >

Public Types

typedef ValueType value_type
 
typedef int32 difference_type
 
typedef uint32 index_type
 
typedef uint32 size_type
 
typedef SpanInternal::SpanIterator< derived_type, true > const_iterator
 
typedef SpanInternal::SpanIterator< derived_type, false > iterator
 
typedef value_type * pointer
 
typedef const value_type * const_pointer
 
typedef value_type & reference
 
typedef const value_type & const_reference
 

Public Member Functions

size_type byteSize () const
 
const_reference operator[] (const index_type index) const
 
reference operator[] (const index_type index)
 
int8 getInt8At (const index_type index) const
 
uint8 getUint8At (const index_type index) const
 
int16 getInt16BEAt (const index_type index) const
 
int16 getInt16LEAt (const index_type index) const
 
uint16 getUint16BEAt (const index_type index) const
 
uint16 getUint16LEAt (const index_type index) const
 
uint32 getUint24LEAt (const index_type index) const
 
uint32 getUint32At (const index_type index) const
 
int32 getInt32BEAt (const index_type index) const
 
int32 getInt32LEAt (const index_type index) const
 
uint32 getUint32BEAt (const index_type index) const
 
uint32 getUint32LEAt (const index_type index) const
 
String getStringAt (const index_type index, size_type numEntries=kSpanMaxSize) const
 
const_pointer getUnsafeDataAt (const index_type index, size_type numEntries=kSpanMaxSize) const
 
pointer getUnsafeDataAt (const index_type index, size_type numEntries=kSpanMaxSize)
 
MemoryReadStream toStream (const index_type index=0, size_type numEntries=kSpanMaxSize) const
 
template<typename Other >
bool operator== (const Other &other) const
 
template<typename Other >
bool operator!= (const Other &other) const
 
template<typename Other >
difference_type operator- (const Other &other) const
 
template<typename Other >
bool operator< (const Other &other) const
 
template<typename Other >
bool operator<= (const Other &other) const
 
template<typename Other >
bool operator> (const Other &other) const
 
template<typename Other >
bool operator>= (const Other &other) const
 
void unsafeCopyDataTo (void *target) const
 
template<typename Other >
void copyDataTo (Other &target) const
 
- Public Member Functions inherited from Common::SafeBool< Derived< ValueType > >
 operator bool_type () const
 
 operator bool_type ()
 

Protected Member Functions

 SpanBase (const SpanBase &)
 
SpanBaseoperator= (const SpanBase &)
 
const_derived_type & impl () const
 
mutable_derived_type & impl ()
 
void clear ()
 
size_type size () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
pointer data () const
 
bool operator_bool () const
 
bool checkInvalidBounds (const index_type index, const difference_type deltaInBytes) const
 
void validate (const index_type index, const difference_type deltaInBytes, const SpanValidationMode mode=kValidateRead) const
 

Member Function Documentation

◆ getUnsafeDataAt()

template<typename ValueType, template< typename > class Derived>
const_pointer Common::SpanBase< ValueType, Derived >::getUnsafeDataAt ( const index_type  index,
size_type  numEntries = kSpanMaxSize 
) const
inline

Returns a raw pointer to memory after validating the given index and size. Use this only in performance-critical code, like processing pixel data in a loop, where validating each read independently would introduce unnecessary overhead.

◆ unsafeCopyDataTo()

template<typename ValueType, template< typename > class Derived>
void Common::SpanBase< ValueType, Derived >::unsafeCopyDataTo ( void *  target) const
inline

Copies data from this span to a raw pointer. To only copy a portion of the span, call subspan first.

◆ copyDataTo()

template<typename ValueType, template< typename > class Derived>
template<typename Other >
void Common::SpanBase< ValueType, Derived >::copyDataTo ( Other &  target) const
inline

Copies the data from this span to the given target span. To only copy a portion of the span, call subspan first.

◆ checkInvalidBounds()

template<typename ValueType, template< typename > class Derived>
bool Common::SpanBase< ValueType, Derived >::checkInvalidBounds ( const index_type  index,
const difference_type  deltaInBytes 
) const
inlineprotected
Returns
true if bounds are invalid.

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