cc_tools_qt
Common Environment for Protocol Analysis.
Loading...
Searching...
No Matches
ToolsFrame.h
1//
2// Copyright 2024 - 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/ToolsApi.h"
23#include "cc_tools_qt/ToolsDataInfo.h"
24#include "cc_tools_qt/ToolsMessage.h"
25#include "cc_tools_qt/version.h"
26
27#include <memory>
28#include <list>
29
30namespace cc_tools_qt
31{
32
33class CC_TOOLS_API ToolsFrame
34{
35public:
36 using DataSeq = ToolsMessage::DataSeq;
37
38 virtual ~ToolsFrame();
39
40 ToolsMessagesList readData(const ToolsDataInfo& dataInfo, bool final);
41 void updateMessage(ToolsMessage& msg);
42 ToolsMessagePtr createInvalidMessage();
43 ToolsMessagePtr createRawDataMessage();
44 ToolsMessagePtr createExtraInfoMessage();
45 ToolsMessagesList createAllMessages();
46 ToolsMessagePtr createMessage(const QString& idAsString, unsigned idx);
47 DataSeq writeProtMsg(const void* protInterface);
48
49protected:
50 ToolsFrame() = default;
51
52 virtual ToolsMessagesList readDataImpl(const ToolsDataInfo& dataInfo, bool final) = 0;
53 virtual void updateMessageImpl(ToolsMessage& msg) = 0;
54 virtual ToolsMessagePtr createInvalidMessageImpl() = 0;
55 virtual ToolsMessagePtr createRawDataMessageImpl() = 0;
56 virtual ToolsMessagePtr createExtraInfoMessageImpl() = 0;
57 virtual ToolsMessagesList createAllMessagesImpl() = 0;
58 virtual ToolsMessagePtr createMessageImpl(const QString& idAsString, unsigned idx) = 0;
59 virtual DataSeq writeProtMsgImpl(const void* protInterface) = 0;
60};
61
62using ToolsFramePtr = std::unique_ptr<ToolsFrame>;
63
64} // namespace cc_tools_qt
65
Main namespace for all classes / functions of the shared library.
std::shared_ptr< ToolsMessage > ToolsMessagePtr
Smart pointer to ToolsMessage.
Definition ToolsMessage.h:165