Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
Factory Class Reference

This class is responsible for creating instances of classes based on their name or hash and is mainly used for deserialization of saved data. More...

#include <Factory.h>

Public Member Functions

JPH_OVERRIDE_NEW_DELETE void * CreateObject (const char *inName)
 Create an object. More...
 
const RTTIFind (const char *inName)
 Find type info for a specific class by name. More...
 
const RTTIFind (uint32 inHash)
 Find type info for a specific class by hash. More...
 
bool Register (const RTTI *inRTTI)
 Register an object with the factory. Returns false on failure. More...
 
bool Register (const RTTI **inRTTIs, uint inNumber)
 Register a list of objects with the factory. Returns false on failure. More...
 
void Clear ()
 Unregisters all types. More...
 
Array< const RTTI * > GetAllClasses () const
 Get all registered classes. More...
 

Static Public Attributes

static FactorysInstance = nullptr
 Singleton factory instance. More...
 

Detailed Description

This class is responsible for creating instances of classes based on their name or hash and is mainly used for deserialization of saved data.

Member Function Documentation

◆ Clear()

void Factory::Clear ( )

Unregisters all types.

◆ CreateObject()

void * Factory::CreateObject ( const char *  inName)

Create an object.

◆ Find() [1/2]

const RTTI * Factory::Find ( const char *  inName)

Find type info for a specific class by name.

◆ Find() [2/2]

const RTTI * Factory::Find ( uint32  inHash)

Find type info for a specific class by hash.

◆ GetAllClasses()

Array< const RTTI * > Factory::GetAllClasses ( ) const

Get all registered classes.

◆ Register() [1/2]

bool Factory::Register ( const RTTI **  inRTTIs,
uint  inNumber 
)

Register a list of objects with the factory. Returns false on failure.

◆ Register() [2/2]

bool Factory::Register ( const RTTI inRTTI)

Register an object with the factory. Returns false on failure.

Member Data Documentation

◆ sInstance

JPH_NAMESPACE_BEGIN Factory * Factory::sInstance = nullptr
static

Singleton factory instance.


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