cc_tools_qt
Common Environment for Protocol Analysis.
Loading...
Searching...
No Matches
ToolsFilter.h
1//
2// Copyright 2014 - 2025 (C). Alex Robenko. All rights reserved.
3//
4
5// This file is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18
19#pragma once
20
21#include "cc_tools_qt/ToolsApi.h"
22#include "cc_tools_qt/ToolsDataInfo.h"
23#include "cc_tools_qt/version.h"
24
25#include <QtCore/QObject>
26#include <QtCore/QList>
27#include <QtCore/QString>
28
29#include <cstdint>
30#include <cstddef>
31#include <vector>
32
33namespace cc_tools_qt
34{
35
40class CC_TOOLS_API ToolsFilter : public QObject
41{
42 Q_OBJECT
43public:
46
48 virtual ~ToolsFilter() noexcept;
49
56 bool start();
57
62 void stop();
63
71 QList<ToolsDataInfoPtr> recvData(ToolsDataInfoPtr dataPtr);
72
80 QList<ToolsDataInfoPtr> sendData(ToolsDataInfoPtr dataPtr);
81
84 void socketConnectionReport(bool connected);
85
91 void applyInterPluginConfig(const QVariantMap& props);
92
95 void setDebugOutputLevel(unsigned level = 0U);
96
97signals:
100 void sigDataToSendReport(ToolsDataInfoPtr data);
101
104 void sigErrorReport(const QString& msg);
105
108 void sigInterPluginConfigReport(const QVariantMap& props);
109
110protected:
115 virtual bool startImpl();
116
120 virtual void stopImpl();
121
125 virtual QList<ToolsDataInfoPtr> recvDataImpl(ToolsDataInfoPtr dataPtr);
126
130 virtual QList<ToolsDataInfoPtr> sendDataImpl(ToolsDataInfoPtr dataPtr);
131
134 virtual void socketConnectionReportImpl(bool connected);
135
139 virtual void applyInterPluginConfigImpl(const QVariantMap& props);
140
142 virtual const char* debugNameImpl() const;
143
145 static unsigned long long currTimestamp();
146
148 unsigned getDebugOutputLevel() const;
149
150protected slots:
156 void reportDataToSend(ToolsDataInfoPtr dataPtr);
157
163 void reportError(const QString& msg);
164
172 void reportInterPluginConfig(const QVariantMap& props);
173
174private:
175 struct InnerState;
176 std::unique_ptr<InnerState> m_state;
177};
178
180using ToolsFilterPtr = std::shared_ptr<ToolsFilter>;
181
182} // namespace cc_tools_qt
183
Main polymorphic interface class for filters.
Definition ToolsFilter.h:41
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:58
std::shared_ptr< ToolsFilter > ToolsFilterPtr
Pointer to ToolsFilter object.
Definition ToolsFilter.h:180