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
24#include <QtCore/QObject>
25#include <QtCore/QList>
26#include <QtCore/QString>
27
28#include <cstdint>
29#include <cstddef>
30#include <vector>
31
32namespace cc_tools_qt
33{
34
39class CC_TOOLS_API ToolsFilter : public QObject
40{
41 Q_OBJECT
42public:
45
47 virtual ~ToolsFilter() noexcept;
48
55 bool start();
56
61 void stop();
62
70 QList<ToolsDataInfoPtr> recvData(ToolsDataInfoPtr dataPtr);
71
79 QList<ToolsDataInfoPtr> sendData(ToolsDataInfoPtr dataPtr);
80
83 void socketConnectionReport(bool connected);
84
90 void applyInterPluginConfig(const QVariantMap& props);
91
94 void setDebugOutputLevel(unsigned level = 0U);
95
96signals:
99 void sigDataToSendReport(ToolsDataInfoPtr data);
100
103 void sigErrorReport(const QString& msg);
104
107 void sigInterPluginConfigReport(const QVariantMap& props);
108
109protected:
114 virtual bool startImpl();
115
119 virtual void stopImpl();
120
124 virtual QList<ToolsDataInfoPtr> recvDataImpl(ToolsDataInfoPtr dataPtr);
125
129 virtual QList<ToolsDataInfoPtr> sendDataImpl(ToolsDataInfoPtr dataPtr);
130
133 virtual void socketConnectionReportImpl(bool connected);
134
138 virtual void applyInterPluginConfigImpl(const QVariantMap& props);
139
141 virtual const char* debugNameImpl() const;
142
148 void reportDataToSend(ToolsDataInfoPtr dataPtr);
149
155 void reportError(const QString& msg);
156
164 void reportInterPluginConfig(const QVariantMap& props);
165
167 static unsigned long long currTimestamp();
168
170 unsigned getDebugOutputLevel() const;
171
172private:
173 struct InnerState;
174 std::unique_ptr<InnerState> m_state;
175};
176
178using ToolsFilterPtr = std::shared_ptr<ToolsFilter>;
179
180} // namespace cc_tools_qt
181
Main polymorphic interface class for filters.
Definition ToolsFilter.h:40
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:57
std::shared_ptr< ToolsFilter > ToolsFilterPtr
Pointer to ToolsFilter object.
Definition ToolsFilter.h:178