Serenity Operating System
1/*
2 * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
3 * Copyright (c) 2022, the SerenityOS developers.
4 *
5 * SPDX-License-Identifier: BSD-2-Clause
6 */
7
8#pragma once
9
10#include <LibGUI/Model.h>
11
12namespace Profiler {
13
14class Profile;
15
16class IndividualSampleModel final : public GUI::Model {
17public:
18 static NonnullRefPtr<IndividualSampleModel> create(Profile& profile, size_t event_index)
19 {
20 return adopt_ref(*new IndividualSampleModel(profile, event_index));
21 }
22
23 enum Column {
24 Address,
25 ObjectName,
26 Symbol,
27 __Count
28 };
29
30 virtual ~IndividualSampleModel() override = default;
31
32 virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override;
33 virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override;
34 virtual DeprecatedString column_name(int) const override;
35 virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole) const override;
36
37private:
38 IndividualSampleModel(Profile&, size_t event_index);
39
40 Profile& m_profile;
41 size_t const m_event_index { 0 };
42};
43
44}