载入中...
搜索中...
未找到
eve::ui::DatabasePanel类 参考

Reflection-driven database panel (DevTools, MVVM). 更多...

#include <DatabasePanel.h>

Public 成员函数

 DatabasePanel ()=default
 Database panel.
 
 ~DatabasePanel ()
 Database panel.
 
 DatabasePanel (const DatabasePanel &)=delete
 
DatabasePanel & operator= (const DatabasePanel &)=delete
 
void open ()
 Mounts (or updates) the database host on the UI ECS world.
 
void close ()
 Hides the database host.
 
bool isOpen () const
 True while the database host is mounted and visible.
 
UIHostHandle host () const noexcept
 Returns the mounted database host handle, or an empty handle until open().
 
void refresh ()
 Re-scans reflected classes and refreshes the grid.
 
bool selectClass (const std::string &name)
 Selects a class for the grid.
 
const std::string & selectedClass () const
 Name of the currently selected class ("" when none).
 
eve::Result< ObjectHandle > createInstance ()
 Creates and registers an instance of the selected class.
 
eve::Result< ObjectHandle > registerObject (const ssq::Object &object, const std::string &label={})
 Registers a live script object (auto-derives class when empty).
 
eve::Result< void > unregister (ObjectHandle handle)
 Removes an entry from the registry and refreshes the grid.
 
void sync ()
 Pulls model → view for visible cells (per-frame).
 
WidgetDesc build ()
 Declarative tree of the current selection.
 

详细描述

Reflection-driven database panel (DevTools, MVVM).

Left/top: class menu generated from reflected script classes. Below: one editable row per registered instance (ObjectRegistry), with one cell per reflected member. Cell edits write back to the live script instance; sync() pulls model changes back into the grid.

Grid cells reuse the declarative widget set (InputText / Checkbox / Combo / read-only text), so no separate table node type is needed.

在文件 DatabasePanel.h 第 29 行定义.

构造及析构函数说明

◆ DatabasePanel() [1/2]

eve::ui::DatabasePanel::DatabasePanel ( )
default

Database panel.

◆ ~DatabasePanel()

eve::ui::DatabasePanel::~DatabasePanel ( )

Database panel.

在文件 DatabasePanel.cpp 第 51 行定义.

引用了 host(), eve::ui::UIHost::resolve(), eve::ModuleManager::runtime() , 以及 eve::ui::window().

◆ DatabasePanel() [2/2]

eve::ui::DatabasePanel::DatabasePanel ( const DatabasePanel &  )
delete

成员函数说明

◆ build()

◆ close()

void eve::ui::DatabasePanel::close ( )

Hides the database host.

在文件 DatabasePanel.cpp 第 73 行定义.

引用了 host() , 以及 eve::ui::UIHost::resolve().

◆ createInstance()

eve::Result< ObjectHandle > eve::ui::DatabasePanel::createInstance ( )

Creates and registers an instance of the selected class.

返回
A generation-qualified UI object handle, or a structured failure.

在文件 DatabasePanel.cpp 第 110 行定义.

引用了 eve::ui::ObjectRegistry::create(), eve::Diagnostic::error(), eve::Result< T >::failure(), handle, eve::ui::ObjectRegistry::instance(), eve::InvalidArgument , 以及 eve::Result< T >::success().

◆ host()

UIHostHandle eve::ui::DatabasePanel::host ( ) const
inlinenoexcept

Returns the mounted database host handle, or an empty handle until open().

在文件 DatabasePanel.h 第 45 行定义.

被这些函数引用 close(), isOpen(), open() , 以及 ~DatabasePanel().

◆ isOpen()

bool eve::ui::DatabasePanel::isOpen ( ) const

True while the database host is mounted and visible.

在文件 DatabasePanel.cpp 第 77 行定义.

引用了 host() , 以及 eve::ui::UIHost::resolve().

◆ open()

void eve::ui::DatabasePanel::open ( )

Mounts (or updates) the database host on the UI ECS world.

在文件 DatabasePanel.cpp 第 61 行定义.

引用了 eve::ui::UIHost::createHost(), host(), refresh() , 以及 eve::ui::UIHost::resolve().

◆ operator=()

DatabasePanel & eve::ui::DatabasePanel::operator= ( const DatabasePanel &  )
delete

◆ refresh()

void eve::ui::DatabasePanel::refresh ( )

Re-scans reflected classes and refreshes the grid.

在文件 DatabasePanel.cpp 第 82 行定义.

引用了 cls , 以及 eve::ModuleManager::runtime().

被这些函数引用 open().

◆ registerObject()

eve::Result< ObjectHandle > eve::ui::DatabasePanel::registerObject ( const ssq::Object &  object,
const std::string &  label = {} 
)

Registers a live script object (auto-derives class when empty).

返回
A generation-qualified UI object handle, or a structured failure.

在文件 DatabasePanel.cpp 第 125 行定义.

引用了 eve::Result< T >::failure(), handle, eve::ui::ObjectRegistry::instance(), label, eve::ui::ObjectRegistry::registerObject() , 以及 eve::Result< T >::success().

◆ selectClass()

bool eve::ui::DatabasePanel::selectClass ( const std::string &  name)

Selects a class for the grid.

在文件 DatabasePanel.cpp 第 100 行定义.

引用了 name.

◆ selectedClass()

const std::string & eve::ui::DatabasePanel::selectedClass ( ) const
inline

Name of the currently selected class ("" when none).

在文件 DatabasePanel.h 第 52 行定义.

◆ sync()

void eve::ui::DatabasePanel::sync ( )

◆ unregister()

eve::Result< void > eve::ui::DatabasePanel::unregister ( ObjectHandle  handle)

Removes an entry from the registry and refreshes the grid.

参数
handleThe generation-qualified handle to remove.
返回
Applied on success, or a structured stale/invalid failure.

在文件 DatabasePanel.cpp 第 136 行定义.

引用了 eve::Applied, eve::Result< T >::failure(), handle, eve::ui::ObjectRegistry::instance() , 以及 eve::ui::ObjectRegistry::unregister().


该类的文档由以下文件生成: