ladybird/Userland/Libraries/LibSQL/Key.h
Jan de Visser 85a84b0794 LibSQL: Introduce Serializer as a mediator between Heap and client code
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.
2021-08-21 22:03:30 +02:00

29 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 };
};
}