Karma Engine
Loading...
Searching...
No Matches
Karma::UObject Class Reference

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

#include <Object.h>

Inheritance diagram for Karma::UObject:
Collaboration diagram for Karma::UObject:

Public Member Functions

 UObject ()
 
virtual void FinishDestroy ()
 
virtual const std::string & GetDesc ()
 Return a one line description of an object for viewing in the thumbnail view of the generic browser.
 
virtual class UWorldGetWorld () const
 Returns what UWorld this object is contained within.
 
bool IsValidChecked (const UObject *Test)
 
virtual void BeginDestroy ()
 Called before destroying the object. This is called immediately upon deciding to destroy the object, to allow the object to begin an asynchronous cleanup process.
 
FORCEINLINE bool Modify (bool bAlwaysMarkDirty=true)
 
bool IsSelected () const
 Test the selection state of a UObject.
 
- Public Member Functions inherited from Karma::UObjectBase
 UObjectBase (UClass *inClass, EObjectFlags inFlags, EInternalObjectFlags inInternalFlags, UObject *inOuter, const std::string &inName)
 
UPackageGetPackage () const
 
UPackageGetExternalPackage () const
 
bool IsUnreachable () const
 
FORCEINLINE void SetInternalIndex (uint32_t StoreIndex)
 
FORCEINLINE uint32_t GetInterIndex () const
 
void MarkAsGarbage ()
 
void ClearGarbage ()
 
FORCEINLINE const std::string & GetName () const
 
FORCEINLINE void SetObjectName (const std::string &aName)
 
FORCEINLINE UObjectGetOuter () const
 
UObjectGetTypedOuter (UClass *Target) const
 
template<typename T >
T * GetTypedOuter () const
 
bool IsValidLowLevel () const
 
template<typename OtherClassType >
FORCEINLINE bool IsA (OtherClassType SomeBase) const
 
FORCEINLINE UClassGetClass () const
 
FORCEINLINE EObjectFlags GetFlags () const
 
FORCEINLINE void SetFlags (EObjectFlags NewFlags)
 
FORCEINLINE void ClearFlags (EObjectFlags NewFlags)
 
FORCEINLINE bool HasAnyFlags (EObjectFlags FlagsToCheck) const
 
FORCEINLINE bool HasAnyInternalFlags (EInternalObjectFlags FlagsToCheck) const
 
FORCEINLINE void SetInternalFlags (EInternalObjectFlags FlagsToSet) const
 
FORCEINLINE void AddToRoot ()
 

Static Public Member Functions

static const char * StaticConfigName ()
 
- Static Public Member Functions inherited from Karma::UObjectBase
static FORCEINLINE EInternalObjectFlags FixGarbageOrPendingKillInternalObjectFlags (const EInternalObjectFlags InFlags)
 

Additional Inherited Members

- Protected Member Functions inherited from Karma::UObjectBase
FORCEINLINE void SetFlagsTo (EObjectFlags NewFlags)
 

Detailed Description

The base class of all the game code relevant objects.

The base class of all UE objects. The type of an object is defined by its UClass. This provides support functions for creating and using objects, and virtual functions that should be overridden in child classes.

See also
https://docs.unrealengine.com/ProgrammingAndScripting/ProgrammingWithCPP/UnrealArchitecture/Objects

Constructor & Destructor Documentation

◆ UObject()

Karma::UObject::UObject ( )

Default constructor does nothing for now except well, being used as default constructor in DECLARE_KARMA_CLASS which is needed for placement new and, thus, initializing the UObject

See also
#define DEFINE_DEFAULT_CONSTRUCTOR_CALL(TClass)
https://forums.unrealengine.com/t/placement-new-for-aactor-spawning/1223044
Since
Karma 1.0.0

Member Function Documentation

◆ BeginDestroy()

void Karma::UObject::BeginDestroy ( )
virtual

Called before destroying the object. This is called immediately upon deciding to destroy the object, to allow the object to begin an asynchronous cleanup process.

Todo
To be written with Shiva logic for UObject destruction.
Since
Karma 1.0.0

Reimplemented in Karma::UActorComponent, Karma::UChildActorComponent, and Karma::USceneComponent.

◆ FinishDestroy()

void Karma::UObject::FinishDestroy ( )
virtual

Called to finish destroying the object. After UObject::FinishDestroy is called, the object's memory should no longer be accessed.

Warning
Because properties are destroyed here, Super::FinishDestroy() should always be called at the end of your child class's FinishDestroy() method, rather than at the beginning.
Todo
To be written with Shiva logic for UObject destruction.
Since
Karma 1.0.0

◆ GetDesc()

virtual const std::string & Karma::UObject::GetDesc ( )
inlinevirtual

Return a one line description of an object for viewing in the thumbnail view of the generic browser.

Todo
Place holder for now. Plan to rewrite once Editor reaches that stage
Since
Karma 1.0.0

Reimplemented in Karma::UClass.

◆ GetWorld()

class UWorld * Karma::UObject::GetWorld ( ) const
virtual

Returns what UWorld this object is contained within.

By default this will follow its Outer chain, but it should be overridden if that will not work.

Since
Karma 1.0.0

Reimplemented in Karma::AActor, and Karma::ULevel.

◆ IsSelected()

bool Karma::UObject::IsSelected ( ) const

Test the selection state of a UObject.

Returns
true if the object is selected, false otherwise.
Todo
UE this doesn't belong here, but it doesn't belong anywhere else any better. To be written after Editor is functional with UObjects
Since
Karma 1.0.0

◆ IsValidChecked()

bool Karma::UObject::IsValidChecked ( const UObject * Test)

Test validity of object similar to IsValid(Test) however the null pointer test is skipped

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

◆ Modify()

FORCEINLINE bool Karma::UObject::Modify ( bool bAlwaysMarkDirty = true)
inline

Note that the object will be modified. If we are currently recording into the transaction buffer (undo/redo), save a copy of this object into the buffer and marks the package as needing to be saved.

Parameters
bAlwaysMarkDirtyif true, marks the package dirty even if we aren't currently recording an active undo/redo transaction
Returns
true if the object was saved to the transaction buffer
Since
Karma 1.0.0

◆ StaticConfigName()

static const char * Karma::UObject::StaticConfigName ( )
inlinestatic

A legacy function from UE


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