mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:27:45 +00:00
LibCore+LibGUI: Make ObjectClassRegistration::construct() nullable
This lays the groundwork for allowing the registration of abstract core objects, which will be needed for improved GML autocomplete.
This commit is contained in:
parent
0e537e2e1f
commit
c3b0b9057e
3 changed files with 14 additions and 12 deletions
|
@ -32,12 +32,12 @@ class ObjectClassRegistration {
|
|||
AK_MAKE_NONMOVABLE(ObjectClassRegistration);
|
||||
|
||||
public:
|
||||
ObjectClassRegistration(StringView class_name, Function<NonnullRefPtr<Object>()> factory, ObjectClassRegistration* parent_class = nullptr);
|
||||
ObjectClassRegistration(StringView class_name, Function<RefPtr<Object>()> factory, ObjectClassRegistration* parent_class = nullptr);
|
||||
~ObjectClassRegistration();
|
||||
|
||||
String class_name() const { return m_class_name; }
|
||||
const ObjectClassRegistration* parent_class() const { return m_parent_class; }
|
||||
NonnullRefPtr<Object> construct() const { return m_factory(); }
|
||||
RefPtr<Object> construct() const { return m_factory(); }
|
||||
bool is_derived_from(const ObjectClassRegistration& base_class) const;
|
||||
|
||||
static void for_each(Function<void(const ObjectClassRegistration&)>);
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
|
||||
private:
|
||||
StringView m_class_name;
|
||||
Function<NonnullRefPtr<Object>()> m_factory;
|
||||
Function<RefPtr<Object>()> m_factory;
|
||||
ObjectClassRegistration* m_parent_class { nullptr };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue