cc_tools_qt
Common Environment for Protocol Analysis.
Loading...
Searching...
No Matches
ToolsFilter.h
1//
2// Copyright 2014 - 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/version.h"
25
26#include <QtCore/QObject>
27#include <QtCore/QList>
28#include <QtCore/QString>
29
30#include <cstdint>
31#include <cstddef>
32#include <vector>
33
34namespace cc_tools_qt
35{
36
41class CC_TOOLS_API ToolsFilter : public QObject
42{
43 Q_OBJECT
44public:
47
49 virtual ~ToolsFilter() noexcept;
50
57 bool start();
58
63 void stop();
64
72 QList<ToolsDataInfoPtr> recvData(ToolsDataInfoPtr dataPtr);
73
81 QList<ToolsDataInfoPtr> sendData(ToolsDataInfoPtr dataPtr);
82
85 void socketConnectionReport(bool connected);
86
92 void applyInterPluginConfig(const QVariantMap& props);
93
96 void setDebugOutputLevel(unsigned level = 0U);
97
98signals:
101 void sigDataToSendReport(ToolsDataInfoPtr data);
102
105 void sigErrorReport(const QString& msg);
106
109 void sigInterPluginConfigReport(const QVariantMap& props);
110
111protected:
116 virtual bool startImpl();
117
121 virtual void stopImpl();
122
126 virtual QList<ToolsDataInfoPtr> recvDataImpl(ToolsDataInfoPtr dataPtr);
127
131 virtual QList<ToolsDataInfoPtr> sendDataImpl(ToolsDataInfoPtr dataPtr);
132
135 virtual void socketConnectionReportImpl(bool connected);
136
140 virtual void applyInterPluginConfigImpl(const QVariantMap& props);
141
143 virtual const char* debugNameImpl() const;
144
146 static unsigned long long currTimestamp();
147
149 unsigned getDebugOutputLevel() const;
150
151protected slots:
157 void reportDataToSend(ToolsDataInfoPtr dataPtr);
158
164 void reportError(const QString& msg);
165
173 void reportInterPluginConfig(const QVariantMap& props);
174
175private:
176 struct InnerState;
177 std::unique_ptr<InnerState> m_state;
178};
179
181using ToolsFilterPtr = std::shared_ptr<ToolsFilter>;
182
183} // namespace cc_tools_qt
184
Main polymorphic interface class for filters.
Definition ToolsFilter.h:42
virtual ~ToolsFilter() noexcept
Destructor.
Main namespace for all classes / functions of the shared library.
std::shared_ptr< ToolsDataInfo > ToolsDataInfoPtr
Pointer to ToolsDataInfo.
Definition ToolsDataInfo.h:59
std::shared_ptr< ToolsFilter > ToolsFilterPtr
Pointer to ToolsFilter object.
Definition ToolsFilter.h:181