Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
LifetimeRegistry.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/script_core/lifetime_registry/scripting/HandleCache.h"
7#include "mc/deps/script_core/lifetime_registry/scripting/ObjectHandle.h"
8#include "mc/deps/script_core/lifetime_registry/scripting/ObjectHandleValue.h"
9#include "mc/deps/script_core/lifetime_registry/scripting/internal/TypeCache.h"
10#include "mc/deps/script_core/runtime/scripting/ContextId.h"
11
12// auto generated forward declare list
13// clang-format off
14namespace Scripting { class ILifetimeObjectListener; }
15namespace Scripting { class ILifetimeScopeListener; }
16namespace Scripting { class IScriptRef; }
17namespace Scripting { class LifetimeRegistryReference; }
18namespace Scripting::internal { struct BaseScriptComponent; }
19// clang-format on
20
21namespace Scripting {
22
23class LifetimeRegistry {
24public:
25 // member variables
26 // NOLINTBEGIN
27 ::ll::TypedStorage<1, 1, ::Scripting::ContextId> mContextId;
28 ::ll::TypedStorage<8, 8, ::Scripting::LifetimeRegistryReference&> mRegistryReference;
29 ::ll::TypedStorage<8, 64, ::Scripting::internal::TypeCache> mTypeCache;
30 ::ll::TypedStorage<8, 304, ::entt::basic_registry<::Scripting::ObjectHandleValue>> registry;
31 ::ll::TypedStorage<8, 16, ::Scripting::ObjectHandle> removingEntity;
32 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::Scripting::ILifetimeScopeListener>> mScopeListener;
33 ::ll::TypedStorage<8, 24, ::std::vector<::std::weak_ptr<::Scripting::ILifetimeObjectListener>>> mObjectListeners;
34 ::ll::TypedStorage<8, 128, ::Scripting::HandleCache> handleCache;
35 // NOLINTEND
36
37public:
38 // prevent constructor by default
39 LifetimeRegistry& operator=(LifetimeRegistry const&);
40 LifetimeRegistry(LifetimeRegistry const&);
41 LifetimeRegistry();
42
43public:
44 // member functions
45 // NOLINTBEGIN
47
48 MCNAPI ::Scripting::ObjectHandle _createBaseObject(::Scripting::internal::BaseScriptComponent&& baseScriptComp);
49
50 MCNAPI void
52
53 MCNAPI bool _doTypesMatch(::Scripting::ObjectHandle handle, ::entt::meta_type const& expectedType);
54
56
57 MCNAPI void destroyLifetimeScope(bool expectAllDead);
58
59 MCNAPI ::Scripting::IScriptRef* getScriptRef(::Scripting::ObjectHandle handle);
60
61 MCNAPI void removeObjectListener(::std::shared_ptr<::Scripting::ILifetimeObjectListener> strongListener);
62
64
65 MCNAPI ::entt::meta_any resolveAsAny(::Scripting::ObjectHandle handle);
66
68
70
72
73 MCNAPI ::entt::meta_type const& resolvedType(::Scripting::ObjectHandle handle);
74
75 MCNAPI void setScriptRef(::Scripting::ObjectHandle handle, ::std::unique_ptr<::Scripting::IScriptRef>&& scriptRef);
76
77 MCNAPI bool valid(::Scripting::ObjectHandle const& handle);
78
80 // NOLINTEND
81
82public:
83 // constructor thunks
84 // NOLINTBEGIN
86 // NOLINTEND
87
88public:
89 // destructor thunk
90 // NOLINTBEGIN
91 MCNAPI void $dtor();
92 // NOLINTEND
93};
94
95} // namespace Scripting
Definition ILifetimeObjectListener.h:13
Definition ILifetimeScopeListener.h:12
Definition IScriptRef.h:7
Definition LifetimeRegistryReference.h:12
MCAPI bool valid(::Scripting::ObjectHandle const &handle)
MCAPI bool removeReference(::Scripting::ObjectHandle handle)
MCAPI bool _doTypesMatch(::Scripting::ObjectHandle handle, ::entt::meta_type const &expectedType)
MCAPI::entt::meta_type const & resolvedType(::Scripting::ObjectHandle handle)
MCAPI::entt::meta_any resolveAsStrongTypedObjectHandle(::Scripting::ObjectHandle handle)
MCAPI LifetimeRegistry(::Scripting::ContextId contextId, ::Scripting::LifetimeRegistryReference &registryRef)
MCAPI void removeObjectListener(::std::shared_ptr<::Scripting::ILifetimeObjectListener > strongListener)
MCAPI::Scripting::IScriptRef * getScriptRef(::Scripting::ObjectHandle handle)
MCAPI::entt::meta_any resolveAsTypedObjectHandle(::Scripting::ObjectHandle handle)
MCAPI void destroyLifetimeScope(bool expectAllDead)
MCAPI void _destroyObject(::Scripting::ObjectHandle handle, ::Scripting::internal::BaseScriptComponent &baseScriptComp)
MCAPI::Scripting::ObjectHandle _createBaseObject(::Scripting::internal::BaseScriptComponent &&baseScriptComp)
MCAPI void setScriptRef(::Scripting::ObjectHandle handle, ::std::unique_ptr<::Scripting::IScriptRef > &&scriptRef)
MCAPI void * $ctor(::Scripting::ContextId contextId, ::Scripting::LifetimeRegistryReference &registryRef)
MCAPI void addReference(::Scripting::ObjectHandle handle)
MCAPI::entt::meta_any resolveAsWeakTypedObjectHandle(::Scripting::ObjectHandle handle)
MCAPI::entt::meta_any resolveAsAny(::Scripting::ObjectHandle handle)
Definition ContextId.h:7
Definition ObjectHandle.h:7
Definition BaseScriptComponent.h:7