Commit fa1cfbee authored by Harald Sitter's avatar Harald Sitter 🏳🌈 Committed by Stefan Brüns
Browse files

s/aggrigator/aggregator

parent b375318f
......@@ -25,7 +25,7 @@ if(DOXYGEN_FOUND)
"src/wsdiscoveryclient.h"
"src/wsdiscoveryprobejob.h"
"src/wsdiscoverytargetservice.h"
"src/wsdiscoveryserviceaggrigator.h"
"src/wsdiscoveryserviceaggregator.h"
ALL
USE_STAMP_FILE
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..
......
......@@ -21,7 +21,7 @@
#include <WSDiscoveryClient>
#include <WSDiscoveryProbeJob>
#include <WSDiscoveryTargetService>
#include <WSDiscoveryServiceAggrigator>
#include <WSDiscoveryServiceAggregator>
OnvifDiscover::OnvifDiscover(QObject *parent) : QObject(parent)
{
......@@ -29,10 +29,10 @@ OnvifDiscover::OnvifDiscover(QObject *parent) : QObject(parent)
m_probeJob = new WSDiscoveryProbeJob(m_client);
m_aggrigator = new WSDiscoveryServiceAggrigator(this);
m_aggregator = new WSDiscoveryServiceAggregator(this);
connect(m_probeJob, &WSDiscoveryProbeJob::matchReceived, m_aggrigator, &WSDiscoveryServiceAggrigator::updateService);
connect(m_aggrigator, &WSDiscoveryServiceAggrigator::serviceUpdated, this, &OnvifDiscover::matchReceived);
connect(m_probeJob, &WSDiscoveryProbeJob::matchReceived, m_aggregator, &WSDiscoveryServiceAggregator::updateService);
connect(m_aggregator, &WSDiscoveryServiceAggregator::serviceUpdated, this, &OnvifDiscover::matchReceived);
KDQName type("tdn:NetworkVideoTransmitter");
type.setNameSpace("http://www.onvif.org/ver10/network/wsdl");
......
......@@ -22,7 +22,7 @@
class WSDiscoveryClient;
class WSDiscoveryProbeJob;
class WSDiscoveryTargetService;
class WSDiscoveryServiceAggrigator;
class WSDiscoveryServiceAggregator;
class OnvifDiscover : public QObject
{
......@@ -40,7 +40,7 @@ private slots:
private:
WSDiscoveryClient * m_client;
WSDiscoveryProbeJob * m_probeJob;
WSDiscoveryServiceAggrigator * m_aggrigator;
WSDiscoveryServiceAggregator * m_aggregator;
};
#endif // ONVIFDISCOVER_H
......@@ -29,7 +29,7 @@ set(KDSoapWSDiscoveryClient_SRCS
"wsdiscoveryclient.cpp"
"wsdiscoveryprobejob.cpp"
"wsdiscoverytargetservice.cpp"
"wsdiscoveryserviceaggrigator.cpp"
"wsdiscoveryserviceaggregator.cpp"
)
ecm_qt_declare_logging_category(KDSoapWSDiscoveryClient_SRCS
......@@ -65,7 +65,7 @@ ecm_generate_headers(KDSoapWSDiscoveryClient_HEADERS
WSDiscoveryClient
WSDiscoveryProbeJob
WSDiscoveryTargetService
WSDiscoveryServiceAggrigator
WSDiscoveryServiceAggregator
REQUIRED_HEADERS KDSoapWSDiscoveryClient_HEADERS
)
......
......@@ -15,33 +15,33 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "wsdiscoveryserviceaggrigator.h"
#include "wsdiscoveryserviceaggrigator_p.h"
#include "wsdiscoveryserviceaggregator.h"
#include "wsdiscoveryserviceaggregator_p.h"
WSDiscoveryServiceAggrigator::WSDiscoveryServiceAggrigator(QObject* parent)
WSDiscoveryServiceAggregator::WSDiscoveryServiceAggregator(QObject* parent)
: QObject(parent),
d_ptr(new WSDiscoveryServiceAggrigatorPrivate())
d_ptr(new WSDiscoveryServiceAggregatorPrivate())
{
}
WSDiscoveryServiceAggrigator::~WSDiscoveryServiceAggrigator()
WSDiscoveryServiceAggregator::~WSDiscoveryServiceAggregator()
{
delete d_ptr;
}
void WSDiscoveryServiceAggrigator::updateService(const WSDiscoveryTargetService& receivedService)
void WSDiscoveryServiceAggregator::updateService(const WSDiscoveryTargetService& receivedService)
{
Q_D(WSDiscoveryServiceAggrigator);
Q_D(WSDiscoveryServiceAggregator);
auto endpointReference = receivedService.endpointReference();
auto aggrigatedService = d->targetServiceMap.value(endpointReference);
if(aggrigatedService.isNull()) {
aggrigatedService = QSharedPointer<WSDiscoveryTargetService>::create(endpointReference);
d->targetServiceMap.insert(endpointReference, aggrigatedService);
auto aggregatedService = d->targetServiceMap.value(endpointReference);
if(aggregatedService.isNull()) {
aggregatedService = QSharedPointer<WSDiscoveryTargetService>::create(endpointReference);
d->targetServiceMap.insert(endpointReference, aggregatedService);
}
aggrigatedService->setTypeList(receivedService.typeList());
aggrigatedService->setScopeList(receivedService.scopeList());
aggrigatedService->setXAddrList(receivedService.xAddrList());
aggrigatedService->setLastSeen(receivedService.lastSeen());;
emit serviceUpdated(aggrigatedService);
aggregatedService->setTypeList(receivedService.typeList());
aggregatedService->setScopeList(receivedService.scopeList());
aggregatedService->setXAddrList(receivedService.xAddrList());
aggregatedService->setLastSeen(receivedService.lastSeen());;
emit serviceUpdated(aggregatedService);
}
......@@ -15,23 +15,23 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef WSDISCOVERYSERVICEAGGRIGATOR_H
#define WSDISCOVERYSERVICEAGGRIGATOR_H
#ifndef WSDISCOVERYSERVICEAGGREGATOR_H
#define WSDISCOVERYSERVICEAGGREGATOR_H
#include "wsdiscoveryclient_export.h"
#include <QObject>
class WSDiscoveryTargetService;
class WSDiscoveryServiceAggrigatorPrivate;
class WSDiscoveryServiceAggregatorPrivate;
/*!
* \brief Aggrigates multiple updates from the same WSDiscoveryTargetService
*
* \brief Aggregates multiple updates from the same WSDiscoveryTargetService
*
* When receiving multiple probe and resolve matches of the same service, this
* class will aggrigate those into a single shared instance. This eases the
* class will aggregate those into a single shared instance. This eases the
* administration needed by the application.
*/
class WSDISCOVERYCLIENT_EXPORT WSDiscoveryServiceAggrigator : public QObject
class WSDISCOVERYCLIENT_EXPORT WSDiscoveryServiceAggregator : public QObject
{
Q_OBJECT
......@@ -40,13 +40,13 @@ public:
* Create a WSDiscoveryClient
* \param parent The QObject parent
*/
WSDiscoveryServiceAggrigator(QObject* parent = nullptr);
WSDiscoveryServiceAggregator(QObject* parent = nullptr);
/*!
* Destructor
*/
~WSDiscoveryServiceAggrigator();
~WSDiscoveryServiceAggregator();
signals:
/*!
* Emitted when a service has new information. The service instance is
......@@ -55,7 +55,7 @@ signals:
* \param updatedService A pointer to the updated service
*/
void serviceUpdated(const QSharedPointer<WSDiscoveryTargetService>& updatedService);
public slots:
/*!
* Provides a new service update.
......@@ -64,8 +64,8 @@ public slots:
void updateService(const WSDiscoveryTargetService& receivedService);
private:
WSDiscoveryServiceAggrigatorPrivate* const d_ptr;
Q_DECLARE_PRIVATE(WSDiscoveryServiceAggrigator)
WSDiscoveryServiceAggregatorPrivate* const d_ptr;
Q_DECLARE_PRIVATE(WSDiscoveryServiceAggregator)
};
#endif // WSDISCOVERYSERVICEAGGRIGATOR_H
#endif // WSDISCOVERYSERVICEAGGREGATOR_H
......@@ -15,17 +15,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef WSDISCOVERYSERVICEAGGRIGATOR_P_H
#define WSDISCOVERYSERVICEAGGRIGATOR_P_H
#ifndef WSDISCOVERYSERVICEAGGREGATOR_P_H
#define WSDISCOVERYSERVICEAGGREGATOR_P_H
#include <QSharedPointer>
#include <QObject>
#include "wsdiscoverytargetservice.h"
class WSDiscoveryServiceAggrigatorPrivate
class WSDiscoveryServiceAggregatorPrivate
{
public:
QHash<QString, QSharedPointer<WSDiscoveryTargetService>> targetServiceMap;
};
#endif // WSDISCOVERYSERVICEAGGRIGATOR_P_H
#endif // WSDISCOVERYSERVICEAGGREGATOR_P_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment