Karma Engine
Loading...
Searching...
No Matches
Object.h File Reference

This file contains the class UObject along with helper functions. More...

#include "UObjectBase.h"
#include "GFrameworkMacros.h"
Include dependency graph for Object.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Karma::UObject
 The base class of all the game code relevant objects. More...
 

Typedefs

typedef UClass *(* Karma::StaticClassFunctionType) ()
 

Functions

template<class T >
void Karma::InternalConstructor (const FObjectInitializer &X)
 Helper template to call the default constructor for a class.
 
void Karma::GetPrivateStaticClassBody (const std::string &PackageName, const std::string &Name, UClass *&ReturnClass, size_t InSize, size_t InAlignment, ClassConstructorType InClassConstructor, StaticClassFunctionType InSuperClassFn)
 Helper template to allocate and construct a UClass.
 
void Karma::InitializePrivateStaticClass (class UClass *TClass_Super_StaticClass, class UClass *TClass_PrivateStaticClass, class UClass *TClass_WithinClass_StaticClass, const std::string &PackageName, const std::string &Name)
 
FORCEINLINE bool Karma::TentativeFlagChecks (const UObject *Test)
 Note the name. Need to understand UE's take upon the subject.
 
FORCEINLINE bool Karma::IsValid (const UObject *Test)
 Test validity of object.
 

Detailed Description

This file contains the class UObject along with helper functions.

Author
Ravi Mohan (the_cowboy)
Version
1.0
Date
February 27, 2023

Typedef Documentation

◆ StaticClassFunctionType

typedef UClass *(* Karma::StaticClassFunctionType) ()

A function pointer with UClass return type.

See also
GetPrivateStaticClassBody()

Function Documentation

◆ GetPrivateStaticClassBody()

KARMA_API void Karma::GetPrivateStaticClassBody ( const std::string & PackageName,
const std::string & Name,
UClass *& ReturnClass,
size_t InSize,
size_t InAlignment,
ClassConstructorType InClassConstructor,
StaticClassFunctionType InSuperClassFn )

Helper template to allocate and construct a UClass.

In UE, this helper is declared and defined in Class.h/.cpp. I don't know how that worked, hehe.

Parameters
PackageNamename of the package this class will be inside
Nameof the class
ReturnClassreference to pointer to result. This must be PrivateStaticClass.
RegisterNativeFuncNative function registration function pointer.
InSizeSize of the class
InAlignmentAlignment of the class
InClassFlagsClass flags
InClassCastFlagsClass cast flags
InConfigNameClass config name
InClassConstructorClass constructor function pointer
InClassVTableHelperCtorCallerClass constructor function for vtable pointer
InCppClassStaticFunctionsFunction pointers for the class's version of Unreal's reflected static functions
InSuperClassFnSuper class function pointer
WithinClassWithin class
See also
DECLARE_KARMA_CLASS(TClass, TSuperClass) in GFrameworkMacros.h
Todo
some params are not functional yet
Since
Karma 1.0.0

◆ InitializePrivateStaticClass()

KARMA_API void Karma::InitializePrivateStaticClass ( class UClass * TClass_Super_StaticClass,
class UClass * TClass_PrivateStaticClass,
class UClass * TClass_WithinClass_StaticClass,
const std::string & PackageName,
const std::string & Name )

Shared function called from the various InitializePrivateStaticClass functions generated my the DECLARE_KARMA_CLASS macro. Basically sets up the class hierarchy by setting UStruct::m_SuperStruct with TClass_Super_StaticClass

Parameters
TClass_Super_StaticClassThe class which is base for this class
TClass_PrivateStaticClassThe current class which is being initialized
See also
UClass::SetSuperStruct
Since
Karma 1.0.0

◆ InternalConstructor()

template<class T >
void Karma::InternalConstructor ( const FObjectInitializer & X)

Helper template to call the default constructor for a class.

See also
#define DEFINE_DEFAULT_CONSTRUCTOR_CALL(TClass) in GFrameworkMacros.h

◆ IsValid()

FORCEINLINE bool Karma::IsValid ( const UObject * Test)

Test validity of object.

Parameters
TestThe object to test
Returns
Return true if the object is usable: non-null and not pending kill or garbage
Since
Karma 1.0.0

◆ TentativeFlagChecks()

FORCEINLINE bool Karma::TentativeFlagChecks ( const UObject * Test)

Note the name. Need to understand UE's take upon the subject.

Since
Karma 1.0.0