Navigation
API > API/Runtime > API/Runtime/MassEntity
Once created with MassObserverManager.GetOrMakeObserverLock will prevent triggering observers and instead buffer all the notifications to be sent. Once the FObserverLock gets released it will call MassObserverManager.ResumeExecution that will send out all the buffered notifications.
that due to the buffering, all the "Remove" operation observers will be sent out later than usually - without locking those observers get triggered before the removal operation is performed, and as such have access to the data "about to be removed". Removal observers sent out after lock release won't have access to that information. There's a special path for freshly created entities, see FCreationContext for more details.
| Name | FObserverLock |
| Type | struct |
| Header File | /Engine/Source/Runtime/MassEntity/Public/MassObserverNotificationTypes.h |
| Include Path | #include "MassObserverNotificationTypes.h" |
Syntax
struct FObserverLock
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| MassObserverNotificationTypes.h | |||
FObserverLock
(
FMassObserverManager& ObserverManager |
MassObserverNotificationTypes.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FObserverLock() |
MassObserverNotificationTypes.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| BufferedNotifications | TArray< FBufferedNotification > | MassObserverNotificationTypes.h | ||
| CollectionCreationDuplicatesHandling | FMassArchetypeEntityCollection::EDuplicatesHandling | MassObserverNotificationTypes.h | ||
| CreationNotificationIndex | int32 | MassObserverNotificationTypes.h | ||
| FMassObserverManager | friend | MassObserverNotificationTypes.h | ||
| LockSerialNumber | uint32 | MassObserverNotificationTypes.h | ||
| OwnerThreadId | uint32 | Identifies the thread where given FObserverLock instance was created. | MassObserverNotificationTypes.h | |
| WeakEntityManager | TWeakPtr< FMassEntityManager > | Point to outer EntityManager. Used to obtain ObserverManager in type's destructor | MassObserverNotificationTypes.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const FBufferedNotification & GetCreationNotification
(
FCreationNotificationHandle CreationHandle |
MassObserverNotificationTypes.h | ||
TWeakPtr< FMassEntityManager > GetWeakEntityManager() |
MassObserverNotificationTypes.h | ||
void MarkCreationNotificationDirty
(
FCreationNotificationHandle CreationHandle |
MassObserverNotificationTypes.h |