
Classes reading and writing to the data heap would communicate directly with the Heap object, and transfer ByteBuffers back and forth with it. This makes things like caching and locking hard. Therefore all data persistence activity will be funneled through a Serializer object which in turn submits it to the Heap. Introducing this unfortunately resulted in a huge amount of churn, in which a number of smaller refactorings got caught up as well.
28 lines
588 B
C++
28 lines
588 B
C++
/*
|
|
* Copyright (c) 2021, Jan de Visser <jan@de-visser.net>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/RefPtr.h>
|
|
#include <LibSQL/Forward.h>
|
|
#include <LibSQL/Tuple.h>
|
|
|
|
namespace SQL {
|
|
|
|
class Key : public Tuple {
|
|
public:
|
|
Key() = default;
|
|
explicit Key(NonnullRefPtr<TupleDescriptor> const&);
|
|
explicit Key(NonnullRefPtr<IndexDef>);
|
|
Key(NonnullRefPtr<TupleDescriptor> const&, Serializer&);
|
|
Key(RefPtr<IndexDef>, Serializer&);
|
|
RefPtr<IndexDef> index() const { return m_index; }
|
|
|
|
private:
|
|
RefPtr<IndexDef> m_index { nullptr };
|
|
};
|
|
|
|
}
|