Adapts one live Squirrel instance to the renderer-independent property model. 更多...
#include <ReflectedPropertyModel.h>
类 | |
| struct | ObserverState |
Public 成员函数 | |
| ReflectedPropertyModel (Runtime &runtime, ssq::Object instance) | |
| Bind one live script instance to the shared property-access contract. | |
| ~ReflectedPropertyModel () override | |
| Reflected property model. | |
| ReflectedPropertyModel (const ReflectedPropertyModel &)=delete | |
| ReflectedPropertyModel & | operator= (const ReflectedPropertyModel &)=delete |
| const PropertySchema & | schema () const override |
| Schema. | |
| std::optional< eve::Value > | read (const std::string &path) const override |
| Reads . | |
| WriteResult | write (const std::string &path, const eve::Value &value) override |
| Writes . | |
| std::uint64_t | revision () const override |
| Revision. | |
| Subscription | subscribe (ChangeCallback callback) override |
| Subscribe. | |
| void | rebuildSchema () |
| Rebuild reflection metadata after a script reload. | |
| void | refresh () |
| Pull live values and notify observers for changed properties. | |
Public 成员函数 继承自 eve::property_access::IPropertyAccess | |
| virtual | ~IPropertyAccess ()=default |
| I property access. | |
额外继承的成员函数 | |
Public 类型 继承自 eve::property_access::IPropertyAccess | |
| using | ChangeCallback = std::function< void(const PropertyChange &)> |
详细描述
Adapts one live Squirrel instance to the renderer-independent property model.
Reflection metadata defines the schema while Runtime owns all reads and writes. Scalars, enums, Color/Vec composites (editor="color"|"vec2"|"vec3"|"vec4"), arrays and tables are editable through write(). Nested instances stay ObjectRef as a class-name string and remain read-only; hosts navigate them separately.
This adapter is compiled with property_access but is not part of the L0 contract: PropertyAccess.h stays free of the script runtime. Include this header only from script-aware hosts such as the Inspector.
在文件 ReflectedPropertyModel.h 第 25 行定义.
构造及析构函数说明
◆ ReflectedPropertyModel() [1/2]
| eve::property_access::ReflectedPropertyModel::ReflectedPropertyModel | ( | Runtime & | runtime, |
| ssq::Object | instance | ||
| ) |
Bind one live script instance to the shared property-access contract.
- 参数
-
runtime Borrowed Runtime that performs reflection reads and writes. instance Live Squirrel instance retained by this model. @ownership Does not own runtime; retainsinstancefor the model lifetime. @lifetimeruntimemust outlive this model; do not keep the model across Runtime stop/unload.instancestays rooted until destruction. @thread Call on the UI/script thread that owns the Runtime. @reentrancy Construction reads reflection metadata; do not invoke unknown callbacks while constructing.
在文件 ReflectedPropertyModel.cpp 第 147 行定义.
引用了 rebuildSchema() , 以及 refresh().
◆ ~ReflectedPropertyModel()
|
overridedefault |
Reflected property model.
◆ ReflectedPropertyModel() [2/2]
|
delete |
成员函数说明
◆ operator=()
|
delete |
◆ read()
|
overridevirtual |
Reads .
实现了 eve::property_access::IPropertyAccess.
在文件 ReflectedPropertyModel.cpp 第 225 行定义.
引用了 eve::property_access::PropertySchema::find(), path , 以及 eve::Runtime::readProperty().
被这些函数引用 refresh().
◆ rebuildSchema()
| void eve::property_access::ReflectedPropertyModel::rebuildSchema | ( | ) |
Rebuild reflection metadata after a script reload.
在文件 ReflectedPropertyModel.cpp 第 155 行定义.
引用了 eve::Runtime::classNameOf(), descriptor, member, eve::property_access::PropertyDescriptor::path, eve::property_access::PropertySchema::properties, eve::Runtime::reflectInstance() , 以及 eve::property_access::PropertySchema::typeId.
被这些函数引用 ReflectedPropertyModel().
◆ refresh()
| void eve::property_access::ReflectedPropertyModel::refresh | ( | ) |
Pull live values and notify observers for changed properties.
在文件 ReflectedPropertyModel.cpp 第 301 行定义.
引用了 current, descriptor, found, eve::property_access::PropertySchema::properties , 以及 read().
被这些函数引用 ReflectedPropertyModel().
◆ revision()
|
inlineoverridevirtual |
◆ schema()
|
inlineoverridevirtual |
◆ subscribe()
|
overridevirtual |
◆ write()
|
overridevirtual |
Writes .
实现了 eve::property_access::IPropertyAccess.
在文件 ReflectedPropertyModel.cpp 第 230 行定义.
引用了 eve::property_access::WriteResult::accepted, eve::property_access::Array, eve::Runtime::arrayAppend(), eve::Runtime::arrayRemove(), eve::Runtime::arraySet(), eve::Runtime::arraySize(), eve::property_access::Color, current, descriptor, eve::ReflectedValue::empty(), fields, eve::property_access::PropertySchema::find(), found, index, key, kind, eve::property_access::Map, path, eve::Runtime::readProperty(), eve::property_access::WriteResult::reject(), eve::property_access::Struct, eve::property_access::WriteResult::success(), eve::Runtime::tableKeys(), eve::Runtime::tableRemove(), eve::Runtime::tableSet(), value, eve::property_access::Vec2, eve::property_access::Vec3, eve::property_access::Vec4 , 以及 eve::Runtime::writeProperty().
该类的文档由以下文件生成:
- src/modules/property_access/squirrel/ReflectedPropertyModel.h
- src/modules/property_access/squirrel/ReflectedPropertyModel.cpp
Public 成员函数 继承自