mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
9d89b64d59
Previously, class SQL::Key depends on def class SQL::IndexDef (because inline def index()) depends on def class SQL::KeyPartDef (inline def key_definition()) depends on def class SQL::ColumnDef (because base class) depends on def class SQL::Relation (because base class) depends on def class SQL::Key (because inline def hash()). This hasn't caused any problems so far because Meta.h happened to be always included after Key.h (in part due to alphabetical ordering). However, a compilation that for example only contains #include <Userland/Libraries/LibSQL/Key.h> would fail to compile. This patch resolves this issue by pushing the inline definition of SQL::Relation::hash() into a different file. Yes, this might reduce performance marginally, but this gets it to compile again.
30 lines
613 B
C++
30 lines
613 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/Meta.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 };
|
|
};
|
|
|
|
}
|