mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:07:35 +00:00
Libraries: Fix visibility of Object-derivative constructors
Derivatives of Core::Object should be constructed through ClassName::construct(), to avoid handling ref-counted objects with refcount zero. Fixing the visibility means that misuses like this are more difficult.
This commit is contained in:
parent
3796d417e0
commit
b3e9a4e603
19 changed files with 62 additions and 50 deletions
|
@ -24,7 +24,6 @@ class Database : public Core::Object {
|
|||
C_OBJECT(Database);
|
||||
|
||||
public:
|
||||
explicit Database(String);
|
||||
~Database() override = default;
|
||||
|
||||
void commit() { m_heap->flush(); }
|
||||
|
@ -43,6 +42,8 @@ public:
|
|||
bool update(Row&);
|
||||
|
||||
private:
|
||||
explicit Database(String);
|
||||
|
||||
NonnullRefPtr<Heap> m_heap;
|
||||
Serializer m_serializer;
|
||||
RefPtr<BTree> m_schemas;
|
||||
|
|
|
@ -32,7 +32,6 @@ class Heap : public Core::Object {
|
|||
C_OBJECT(Heap);
|
||||
|
||||
public:
|
||||
explicit Heap(String);
|
||||
virtual ~Heap() override { flush(); }
|
||||
|
||||
u32 size() const { return m_end_of_file; }
|
||||
|
@ -93,6 +92,8 @@ public:
|
|||
void flush();
|
||||
|
||||
private:
|
||||
explicit Heap(String);
|
||||
|
||||
bool seek_block(u32);
|
||||
void read_zero_block();
|
||||
void initialize_zero_block();
|
||||
|
|
|
@ -96,10 +96,11 @@ class KeyPartDef : public ColumnDef {
|
|||
C_OBJECT(KeyPartDef);
|
||||
|
||||
public:
|
||||
KeyPartDef(IndexDef*, String, SQLType, Order = Order::Ascending);
|
||||
Order sort_order() const { return m_sort_order; }
|
||||
|
||||
private:
|
||||
KeyPartDef(IndexDef*, String, SQLType, Order = Order::Ascending);
|
||||
|
||||
Order m_sort_order { Order::Ascending };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue