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

#include <game/bases/d_dylink.hpp>

Inheritance diagram for dDynamicModuleControl:
[legend]

Description

Constructs a new DynamicModuleControl.

Parameters
nameThe module name.
heapThe heap to load the module into, or nullptr to use the default heap.

Definition at line 9 of file d_dylink.hpp.

Public Member Functions

 dDynamicModuleControl (const char *name, EGG::ExpHeap *heap)
 Constructs a new DynamicModuleControl.
virtual ~dDynamicModuleControl ()
 Destroys the DynamicModuleControl.
virtual bool do_link () override
 Module-specific implementation for linking the module, making it ready for use.
Public Member Functions inherited from DynamicModuleControl
 DynamicModuleControl (const char *name, EGG::ExpHeap *heap)
 Constructs a new DynamicModuleControl.
virtual ~DynamicModuleControl ()
 Destroys the DynamicModuleControl.
virtual const char * getModuleName () const override
 Gets the module name.
virtual size_t getModuleSize () const override
 Gets the module size in bytes.
virtual const char * getModuleTypeString () const override
 Gets a human-readable module type string.
virtual void dump () override
 Outputs debug information about the module.
virtual bool do_load () override
 Module-specific implementation for loading the module into memory.
virtual bool do_load_async () override
 Module-specific implementation for loading the module into memory asynchronously.
virtual bool do_unload () override
 Module-specific implementation for unloading the module from memory.
virtual bool do_unlink () override
 Module-specific implementation for unlinking the module.
void checkHeapStatus ()
 Updates the module linking heap statistics.
Public Member Functions inherited from DynamicModuleControlBase
 DynamicModuleControlBase ()
 Constructs a new DynamicModuleControlBase and adds it to the linked list.
virtual ~DynamicModuleControlBase ()
 Destroys the DynamicModuleControlBase and removes it from the linked list.
bool link ()
 Loads and links the module if needed.
bool unlink ()
 Unlinks and unloads the module if needed.
bool load_async ()
 Loads the module asynchronously if needed.

Additional Inherited Members

Public Types inherited from DynamicModuleControl
enum  ModuleType_e {
  MODULE_TYPE_UNKNOWN ,
  MODULE_TYPE_MEM ,
  MODULE_TYPE_ARAM ,
  MODULE_TYPE_DVD
}
 Identifies where the module data is physically located. More...
Static Public Member Functions inherited from DynamicModuleControl
static void initialize (EGG::ExpHeap *heap)
 Initializes the global dynamic linking system.
static void * callback (void *self)
 Internal callback used for asynchronous loading operations.
Public Attributes inherited from DynamicModuleControl
u8 mPad [4]
OSModuleHeader * mpModule
 The data of the module, including the header.
void * mpBss
 The BSS section of the module.
u32 mPrologReturn
 The return value of the module's prolog function.
const char * mModuleName
 The module name.
u8 mType
 The module type. See ModuleType_e.
u8 mLoadCount
 The number of times this module has been loaded.
u16 mChecksum
 The checksum of the module.
int mModuleSize
 The module size, in bytes.
mDvd_callback_cmpDvdCallback
 The DVD command used to load the module asynchronously.
EGG::ExpHeap * mpHeap
 The heap used for module loading and BSS allocation.
DbMapFile mDebugMapFile
 The debug map file for this module.
Static Public Attributes inherited from DynamicModuleControl
static EGG::ExpHeap * sDylinkHeap
 The heap used for dynamic module loading and BSS allocation.
static EGG::DvdFile * sDvdFile
 The DVD file handle used for loading the string table file.
static size_t sAllocBytes
 The total number of bytes allocated across all active modules.
static size_t sHeapMinAllocatableSize
 The lowest observed allocatable space in sDylinkHeap during module loading.
static size_t sHeapMinTotalFreeSize
 The lowest observed free space in sDylinkHeap during module loading.
static const char * sModulesDir = "/rels"
 The directory on the disk where the modules are located.
Static Public Attributes inherited from DynamicModuleControlBase
static DynamicModuleControlBasemFirst
 The first module in the linked list.
static DynamicModuleControlBasemLast
 The last module in the linked list.
Protected Attributes inherited from DynamicModuleControlBase
u16 mUsageCount
 The number of active users of this module. When this reaches zero, the module may be unloaded.
u16 mLinkCount
 The number of times this module has been successfully linked.
DynamicModuleControlBasempPrev
 The previous module in the linked list.
DynamicModuleControlBasempNext
 The next module in the linked list.

Constructor & Destructor Documentation

◆ dDynamicModuleControl()

dDynamicModuleControl::dDynamicModuleControl ( const char * name,
EGG::ExpHeap * heap )

Constructs a new DynamicModuleControl.

Parameters
nameThe module name.
heapThe heap to load the module into, or nullptr to use the default heap.

Definition at line 125 of file d_dylink.cpp.

◆ ~dDynamicModuleControl()

dDynamicModuleControl::~dDynamicModuleControl ( )
virtual

Destroys the DynamicModuleControl.

Definition at line 123 of file d_dylink.cpp.

Member Function Documentation

◆ do_link()

bool dDynamicModuleControl::do_link ( )
overridevirtual

Module-specific implementation for linking the module, making it ready for use.

Returns
Whether the operation was successful.

Reimplemented from DynamicModuleControl.

Definition at line 127 of file d_dylink.cpp.