NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
__partial_array_destructor Class Reference

#include <runtime/class_arrays.hpp>

Description

Guarantees the correct destruction of an array if an exception is thrown during its construction.

[Since the game doesn't support exceptions, this is unused].

Definition at line 10 of file class_arrays.hpp.

Public Member Functions

 __partial_array_destructor (void *pArray, u32 elSize, u32 elCount, dtorPtr pDtor)
 Creates a partial array destructor.
 
 ~__partial_array_destructor ()
 Destroys each array element in reverse order.
 

Public Attributes

void * mpArray
 A pointer to the array memory.
 
u32 mSize
 The size of one array element.
 
u32 mCount
 The total number of array elements.
 
dtorPtr mpDtor
 A pointer to the elements' default destructor.
 
u32 mCurrNum
 The number of currently constructed array elements.
 

Constructor & Destructor Documentation

◆ __partial_array_destructor()

__partial_array_destructor::__partial_array_destructor ( void * pArray,
u32 elSize,
u32 elCount,
dtorPtr pDtor )
inline

Creates a partial array destructor.

Parameters
pArrayA pointer to the array memory.
elSizeThe size of one array element.
elCountThe total number of array elements.
pDtorA pointer to the elements' default destructor, or nullptr .

Definition at line 20 of file class_arrays.hpp.

◆ ~__partial_array_destructor()

__partial_array_destructor::~__partial_array_destructor ( )
inline

Destroys each array element in reverse order.

The function only acts if the array isn't fully constructed.

Definition at line 30 of file class_arrays.hpp.

Member Data Documentation

◆ mpArray

void* __partial_array_destructor::mpArray

A pointer to the array memory.

Definition at line 39 of file class_arrays.hpp.

◆ mSize

u32 __partial_array_destructor::mSize

The size of one array element.

Definition at line 40 of file class_arrays.hpp.

◆ mCount

u32 __partial_array_destructor::mCount

The total number of array elements.

Definition at line 41 of file class_arrays.hpp.

◆ mpDtor

dtorPtr __partial_array_destructor::mpDtor

A pointer to the elements' default destructor.

Definition at line 42 of file class_arrays.hpp.

◆ mCurrNum

u32 __partial_array_destructor::mCurrNum

The number of currently constructed array elements.

Definition at line 43 of file class_arrays.hpp.