cc_tools_qt
Common Environment for Protocol Analysis.
Loading...
Searching...
No Matches
ToolsArrayListField.h
1//
2// Copyright 2015 - 2026 (C). Alex Robenko. All rights reserved.
3//
4// SPDX-License-Identifier: GPL-3.0-or-later
5//
6
7// This file is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20#pragma once
21
22#include "cc_tools_qt/ToolsField.h"
23
24#include <memory>
25#include <vector>
26#include <utility>
27
28namespace cc_tools_qt
29{
30
31namespace field
32{
33
34class CC_TOOLS_API ToolsArrayListField : public ToolsField
35{
36public:
37
38 using ActPtr = std::unique_ptr<ToolsArrayListField>;
39
40 ToolsArrayListField();
41 ToolsArrayListField(const ToolsArrayListField&) = delete;
42 ToolsArrayListField& operator=(const ToolsArrayListField&) = delete;
43
44 virtual ~ToolsArrayListField() noexcept;
45
46 void addField();
47
48 void removeField(int idx);
49
50 unsigned size() const;
51
52 bool hasFixedSize() const;
53
54 void adjustFixedSize();
55
56 void refreshMembers();
57
58 ActPtr actClone();
59
60protected:
61 virtual void addFieldImpl() = 0;
62 virtual void removeFieldImpl(int idx) = 0;
63 virtual unsigned sizeImpl() const = 0;
64 virtual bool hasFixedSizeImpl() const = 0;
65 virtual void adjustFixedSizeImpl() = 0;
66 virtual void refreshMembersImpl() = 0;
67
68 void dispatchImpl(ToolsFieldHandler& handler);
69};
70
71using ToolsArrayListFieldPtr = ToolsArrayListField::ActPtr;
72
73} // namespace field
74
75} // namespace cc_tools_qt
76
Main namespace for all classes / functions of the shared library.