SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::OwnArray< T > Class Template Reference

Base class for SDL memory allocated array wrap. More...

Public Member Functions

constexpr OwnArray (std::nullptr_t=nullptr)
 
constexpr OwnArray (T *ptr, size_t size)
 
constexpr OwnArray (T *ptr)
 
constexpr operator bool () const
 True if not empty.
 
constexpr bool empty () const
 True if size() == 0.
 
constexpr T * data ()
 Data.
 
constexpr const T * data () const
 Data.
 
constexpr size_t size () const
 Size.
 
T * release ()
 Release control on object.
 
void reset (T *newValue=nullptr)
 Reset object.
 
void reset (T *newValue, size_t size)
 Reset object.
 
constexpr T & operator[] (size_t i)
 Access index.
 
constexpr const T & operator[] (size_t i) const
 Access index.
 
T & front ()
 Return first element.
 
T & back ()
 Return last element.
 
T * begin ()
 Get iterator to first element.
 
const T * begin () const
 
const T * cbegin () const
 
T * end ()
 Get iterator to one past end element.
 
const T * end () const
 
const T * cend () const
 

Detailed Description

template<class T>
class SDL::OwnArray< T >
Template Parameters
Tthe wrapped array type, without the []
Category:
Resource

Member Function Documentation

◆ release()

template<class T >
T * SDL::OwnArray< T >::release ( )
inline

You are responsible to call free() on the returned value, if its different than nullptr.

◆ reset() [1/2]

template<class T >
void SDL::OwnArray< T >::reset ( T *  newValue,
size_t  size 
)
inline

You are responsible to call free() on the returned value, if its different than nullptr.

◆ reset() [2/2]

template<class T >
void SDL::OwnArray< T >::reset ( T *  newValue = nullptr)
inline

You are responsible to call free() on the returned value, if its different than nullptr.


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