TNiagaraViewModelManager

A helper class to allow us to hook up Niagara view model types with the source models that they are currently observing.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

NiagaraEditor

Header

/Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Public/ViewModels/TNiagaraViewModelManager.h

Include

#include "ViewModels/TNiagaraViewModelManager.h"

Syntax

template<class ObjectType, class ViewModelType>
class TNiagaraViewModelManager

Remarks

A helper class to allow us to hook up Niagara view model types with the source models that they are currently observing. The assumption is that a ViewModel class will register and unregister the correct the model during its lifetime. Since it is possible that the ViewModel will hold onto the Model with a weak object pointer, we keep track of the registered pair using a separate data structure (aka Handle). You can only unregister with a valid handle. It is possible for a Model to be pointed to by multiple simultaneous ViewModels (like say event handler scripts). If this happens, you can query the additional ViewModels in the GetExistingViewModelForObject method.

Functions

Name Description

Public function Static

void

 

CleanAll()

Called by a module manager to ensure that all known references have been cleared out before module shutdown.

Public function Static

bool

 

GetAllViewModelsForObject

(
    ObjectType* Object,
    TArray< TSharedPtr< ViewModelType >...
)

Public function Static

TSharedPtr< ...

 

GetExistingViewModelForObject

(
    ObjectType* Object,
    int32 WhichIdx
)

Query to determine if any ViewModel is currently pointing at this Model.

Protected function

Handle

 

RegisterViewModelWithMap

(
    ObjectType* Model,
    ViewModelType* ViewModel
)

Called to register a specific Model/ViewModel pair.

Protected function

void

 

UnregisterViewModelWithMap

(
    Handle InHandle
)

Called to forget about a specific Model/ViewModel pair.

Classes

Name

Description

Public class

Handle

Constants

Name

Description

ObjectsToViewModels

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss