Menu
Lumberyard
C++ API Reference (Version 1.10)

AZ::ComponentApplication::Descriptor Struct Reference

Configures the component application. More...

Inherits IObjectFactory.

Classes

class  DynamicModuleDescriptor
 Describes a dynamic module that the application uses. More...
 

Public Member Functions

void * Create (const char *name) override
 Implements the SerializeContext::IObjectFactory:Create() interface. More...
 
void Destroy (void *data) override
 Implements the SerializeContext::IObjectFactory:Destroy() interface. More...
 
 Descriptor ()
 A constructor. More...
 

Static Public Member Functions

static void ReflectSerialize (SerializeContext *context, ComponentApplication *app)
 Reflects this class to the AZ::SerializeContext and AZ::EditContext. More...
 

Public Attributes

bool m_useExistingAllocator
 If true, you must set up an AZ::SystemAllocator instance on your own. If true, all other parameters are ignored. Default: false. More...
 
bool m_grabAllMemory
 If true, uses all available memory minus reserved fields. Default: false. More...
 
bool m_allocationRecords
 If true, tracks memory allocation. Default: true. More...
 
bool m_allocationRecordsSaveNames
 If true, allocates memory for saving the file name of each memory allocation. This way, unloaded module memory leaks have readable names. Default: false. Automatically true if the recording mode is AZ::Debug::AllocationRecords::RECORD_FULL. More...
 
bool m_allocationRecordsAttemptDecodeImmediately
 If true, attempts to decode frames at the time of allocation. This is very expensive and used specifically for debugging allocations that fail to decode. Default: false. More...
 
bool m_autoIntegrityCheck
 If true, checks the heap integrity on each allocation and deallocation. Default: false. More...
 
bool m_markUnallocatedMemory
 If true, sets all memory to 0xcd when it is freed. Default: true. More...
 
bool m_doNotUsePools
 If true, pipes all allocation to a generic allocator instead of pools. This can help when debugging memory problems. Default: false. More...
 
bool m_enableScriptReflection
 If true, enables reflection to the script context. Default: true. More...
 
unsigned int m_pageSize
 Page allocation size. This must be 1024 bytes, aligned. Default: AZ::SystemAllocator::Descriptor::Heap::m_defaultPageSize. More...
 
unsigned int m_poolPageSize
 Page size used for small memory allocations. Must be less than or equal to m_pageSize and a multiple of it. Default: AZ::SystemAllocator::Descriptor::Heap::m_defaultPoolPageSize. More...
 
unsigned int m_memoryBlockAlignment
 Alignment of memory blocks. Default: AZ::SystemAllocator::Descriptor::Heap::m_memoryBlockAlignment. More...
 
AZ::u64 m_memoryBlocksByteSize
 Memory block size, in bytes. This parameter is ignored if m_grabAllMemory is set to true. Default: 0 (uses memory on demand, no preallocation). More...
 
AZ::u64 m_reservedOS
 Reserved memory for the OS, in bytes. Used only when m_grabAllMemory is set to true. Default: 0. More...
 
AZ::u64 m_reservedDebug
 Reserved memory for debugging. Used only when m_grabAllMemory is true. Default: 0. More...
 
Debug::AllocationRecords::Mode m_recordingMode
 When to record stack traces. Default: AZ::Debug::AllocationRecords::RECORD_STACK_IF_NO_FILE_LINE. More...
 
AZ::u64 m_stackRecordLevels
 The number of stack levels to record if stack recording is enabled. Default: 5. More...
 
bool m_enableDrilling
 If true, enables drilling support for the application. This setting is ignored in release builds. Default: true. More...
 
AZStd::vector< DynamicModuleDescriptor, OSStdAllocator > m_modules
 Dynamic modules used by the application. These are loaded on startup. More...
 

Detailed Description

Configures the component application.

This structure can be loaded from a file on disk. If there are values that need to be set by a running application, add them to StartupParameters.

Note
This structure must not contain members that allocate memory from the system allocator. Use AZ::OSAllocator only.

Constructor & Destructor Documentation

◆ Descriptor()

AZ::ComponentApplication::Descriptor::Descriptor ( )

A constructor.

Member Function Documentation

◆ Create()

void* AZ::ComponentApplication::Descriptor::Create ( const char *  name)
override

Implements the SerializeContext::IObjectFactory:Create() interface.

Instead of creating an instance of the component application descriptor for the serializer, it returns a pointer to the current instance. The component descriptor is part of the component application so it does not need to be serialized separately.

◆ Destroy()

void AZ::ComponentApplication::Descriptor::Destroy ( void *  data)
override

Implements the SerializeContext::IObjectFactory:Destroy() interface.

This implementation does nothing because the component descriptor is part of the component application and does not need its own instance for serialization.

◆ ReflectSerialize()

static void AZ::ComponentApplication::Descriptor::ReflectSerialize ( SerializeContext context,
ComponentApplication app 
)
static

Reflects this class to the AZ::SerializeContext and AZ::EditContext.

The serialize context contains information about every Lumberyard class that might need to be saved to persistent storage. The edit context exposes class data to Lumberyard Editor.

Member Data Documentation

◆ m_allocationRecords

bool AZ::ComponentApplication::Descriptor::m_allocationRecords

If true, tracks memory allocation. Default: true.

◆ m_allocationRecordsAttemptDecodeImmediately

bool AZ::ComponentApplication::Descriptor::m_allocationRecordsAttemptDecodeImmediately

If true, attempts to decode frames at the time of allocation. This is very expensive and used specifically for debugging allocations that fail to decode. Default: false.

◆ m_allocationRecordsSaveNames

bool AZ::ComponentApplication::Descriptor::m_allocationRecordsSaveNames

If true, allocates memory for saving the file name of each memory allocation. This way, unloaded module memory leaks have readable names. Default: false. Automatically true if the recording mode is AZ::Debug::AllocationRecords::RECORD_FULL.

◆ m_autoIntegrityCheck

bool AZ::ComponentApplication::Descriptor::m_autoIntegrityCheck

If true, checks the heap integrity on each allocation and deallocation. Default: false.

◆ m_doNotUsePools

bool AZ::ComponentApplication::Descriptor::m_doNotUsePools

If true, pipes all allocation to a generic allocator instead of pools. This can help when debugging memory problems. Default: false.

◆ m_enableDrilling

bool AZ::ComponentApplication::Descriptor::m_enableDrilling

If true, enables drilling support for the application. This setting is ignored in release builds. Default: true.

◆ m_enableScriptReflection

bool AZ::ComponentApplication::Descriptor::m_enableScriptReflection

If true, enables reflection to the script context. Default: true.

◆ m_grabAllMemory

bool AZ::ComponentApplication::Descriptor::m_grabAllMemory

If true, uses all available memory minus reserved fields. Default: false.

◆ m_markUnallocatedMemory

bool AZ::ComponentApplication::Descriptor::m_markUnallocatedMemory

If true, sets all memory to 0xcd when it is freed. Default: true.

◆ m_memoryBlockAlignment

unsigned int AZ::ComponentApplication::Descriptor::m_memoryBlockAlignment

Alignment of memory blocks. Default: AZ::SystemAllocator::Descriptor::Heap::m_memoryBlockAlignment.

◆ m_memoryBlocksByteSize

AZ::u64 AZ::ComponentApplication::Descriptor::m_memoryBlocksByteSize

Memory block size, in bytes. This parameter is ignored if m_grabAllMemory is set to true. Default: 0 (uses memory on demand, no preallocation).

◆ m_modules

AZStd::vector<DynamicModuleDescriptor, OSStdAllocator> AZ::ComponentApplication::Descriptor::m_modules

Dynamic modules used by the application. These are loaded on startup.

◆ m_pageSize

unsigned int AZ::ComponentApplication::Descriptor::m_pageSize

Page allocation size. This must be 1024 bytes, aligned. Default: AZ::SystemAllocator::Descriptor::Heap::m_defaultPageSize.

◆ m_poolPageSize

unsigned int AZ::ComponentApplication::Descriptor::m_poolPageSize

Page size used for small memory allocations. Must be less than or equal to m_pageSize and a multiple of it. Default: AZ::SystemAllocator::Descriptor::Heap::m_defaultPoolPageSize.

◆ m_recordingMode

Debug::AllocationRecords::Mode AZ::ComponentApplication::Descriptor::m_recordingMode

When to record stack traces. Default: AZ::Debug::AllocationRecords::RECORD_STACK_IF_NO_FILE_LINE.

◆ m_reservedDebug

AZ::u64 AZ::ComponentApplication::Descriptor::m_reservedDebug

Reserved memory for debugging. Used only when m_grabAllMemory is true. Default: 0.

◆ m_reservedOS

AZ::u64 AZ::ComponentApplication::Descriptor::m_reservedOS

Reserved memory for the OS, in bytes. Used only when m_grabAllMemory is set to true. Default: 0.

◆ m_stackRecordLevels

AZ::u64 AZ::ComponentApplication::Descriptor::m_stackRecordLevels

The number of stack levels to record if stack recording is enabled. Default: 5.

◆ m_useExistingAllocator

bool AZ::ComponentApplication::Descriptor::m_useExistingAllocator

If true, you must set up an AZ::SystemAllocator instance on your own. If true, all other parameters are ignored. Default: false.


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