.. This is auto generated file. See daBfg/api/das/docs .. _stdlib_resource_slot: ==================== das中的资源槽 ==================== 存储在 :ref:`das+ecs ` 中更方便。 不过,我们可以使用 `daBfg.resource_slot` 模块在 ecs 之外存储 :ref:`NodeHandleWithSlotsAccess ` 。 遗憾的是,NodeHandleWithSlotsAccess 无法存储在本地 das 变量中,因为 das 不会调用本地类型的析构函数。 如果真的需要在 ecs 外部存储句柄,就必须在堆中存储句柄,或在 cpp 端绑定存储句柄。 对于 :ref:`ecs ` 内的节点,热重载也会自动工作。 .. code-block:: das require daBfg.resource_slot some_cpp_binding <| $(var handle : NodeHandleWithSlotsAccess &) some_struct.handle <- root() |> registerAccess("node_name", [[SlotActions update <- [{auto Update("slot_name", "texture_name", 100)}] ]]) <| @(slots_state; var registry : Registry) return <- @ <| // some render code +++++++++ Constants +++++++++ .. _global-resource_slot-DEFAULT_READ_PRIORITY: .. das:attribute:: DEFAULT_READ_PRIORITY = 2147483647 |variable-resource_slot-DEFAULT_READ_PRIORITY| .. _struct-resource_slot-Create: .. das:attribute:: Create Create fields are +--------+------+ +slot +string+ +--------+------+ +resource+string+ +--------+------+ |structure-resource_slot-Create| .. _struct-resource_slot-Update: .. das:attribute:: Update Update fields are +--------+------+ +slot +string+ +--------+------+ +resource+string+ +--------+------+ +priority+int + +--------+------+ |structure-resource_slot-Update| .. _struct-resource_slot-Read: .. das:attribute:: Read Read fields are +--------+------+ +slot +string+ +--------+------+ +priority+int + +--------+------+ |structure-resource_slot-Read| .. _struct-resource_slot-SlotActions: .. das:attribute:: SlotActions SlotActions fields are +------+-------------------------------------------------------------------+ +create+array< :ref:`resource_slot::Create ` >+ +------+-------------------------------------------------------------------+ +update+array< :ref:`resource_slot::Update ` >+ +------+-------------------------------------------------------------------+ +read +array< :ref:`resource_slot::Read ` > + +------+-------------------------------------------------------------------+ |structure-resource_slot-SlotActions| +++++++++++++++ Register access +++++++++++++++ * :ref:`registerAccess (self:daBfg::NameSpace -const;name:string const;slot_decl:resource_slot::SlotActions const;declaration_callback:lambda\<(slots_state:ResourceSlotCore::State const;var reg:daBfg::Registry -const):lambda\\> -const) : ResourceSlotCore::NodeHandleWithSlotsAccess ` .. _function-_at_resource_slot_c__c_registerAccess_S_ls_daBfg_c__c_NameSpace_gr__Cs_CS_ls_resource_slot_c__c_SlotActions_gr__N_ls_slots_state;reg_gr_0_ls_CH_ls_ResourceSlotCore_c__c_State_gr_;S_ls_daBfg_c__c_Registry_gr__gr_1_ls_1_ls_v_gr__at__gr__at_: .. das:function:: registerAccess(self: NameSpace; name: string const; slot_decl: SlotActions const; declaration_callback: lambda<(slots_state:ResourceSlotCore::State const;var reg:daBfg::Registry -const):lambda>) registerAccess returns :ref:`ResourceSlotCore::NodeHandleWithSlotsAccess ` +--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +argument +argument type + +====================+==========================================================================================================================================================+ +self + :ref:`daBfg::NameSpace ` + +--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +name +string const + +--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +slot_decl + :ref:`resource_slot::SlotActions ` const + +--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +declaration_callback+lambda<(slots_state: :ref:`ResourceSlotCore::State ` const;reg: :ref:`daBfg::Registry ` ):lambda<>>+ +--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ |function-resource_slot-registerAccess|