ScummVM API documentation
Common::SpanOwner< OwnedSpan > Class Template Reference

#include <span.h>

Inheritance diagram for Common::SpanOwner< OwnedSpan >:
Common::SafeBool< SpanOwner< OwnedSpan > > Common::impl::no_base< SpanOwner< OwnedSpan > >

Public Member Functions

 SpanOwner (const OwnedSpan &span)
 
 SpanOwner (const SpanOwner &other)
 
SpanOwneroperator= (const SpanOwner &other)
 
SpanOwnermoveFrom (SpanOwner &other)
 
pointer release ()
 
void clear ()
 
const OwnedSpan & operator* () const
 
OwnedSpan & operator* ()
 
const OwnedSpan * operator-> () const
 
OwnedSpan * operator-> ()
 
const_reference operator[] (const index_type index) const
 
reference operator[] (const index_type index)
 
- Public Member Functions inherited from Common::SafeBool< SpanOwner< OwnedSpan > >
 operator bool_type () const
 
 operator bool_type ()
 

Protected Member Functions

bool operator_bool () const
 

Detailed Description

template<typename OwnedSpan>
class Common::SpanOwner< OwnedSpan >

Similar to ScopedPtr, but allows holding and disposing pointers inside Spans without requiring an additional pointer to data, and with copyability.

Constructor & Destructor Documentation

◆ SpanOwner()

template<typename OwnedSpan>
Common::SpanOwner< OwnedSpan >::SpanOwner ( const SpanOwner< OwnedSpan > &  other)
inline

Creates a new owned copy of the memory from the other SpanOwner.

Member Function Documentation

◆ moveFrom()

template<typename OwnedSpan>
SpanOwner& Common::SpanOwner< OwnedSpan >::moveFrom ( SpanOwner< OwnedSpan > &  other)
inline

Transfers ownership of the Span from the other owner to this owner.

◆ release()

template<typename OwnedSpan>
pointer Common::SpanOwner< OwnedSpan >::release ( )
inline

Releases the memory owned by this SpanOwner to the caller.

◆ clear()

template<typename OwnedSpan>
void Common::SpanOwner< OwnedSpan >::clear ( )
inline

Destroys the memory owned by this owner.


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