4
0
mirror of https://github.com/QuasarApp/Patronum.git synced 2025-05-09 13:39:34 +00:00

refactoring private classes

This commit is contained in:
Andrei Yankovich 2020-04-20 13:51:51 +03:00
parent a6d2af3b6c
commit 6a1b557324
24 changed files with 38 additions and 18 deletions

@ -32,10 +32,13 @@ find_package(Qt5 COMPONENTS Core REQUIRED)
file(GLOB SOURCE_CPP
"src/*.cpp"
"src/Private/*.cpp"
)
add_library(${PROJECT_NAME} SHARED ${SOURCE_CPP})
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt-Service QuasarApp)
target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Core Qt-Service QuasarApp)
target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/Private")
setVersion(0 1 0)

@ -0,0 +1 @@
#include "IPController.h"

@ -11,7 +11,7 @@ class Feature;
class IController
{
public:
IController();
IController() = default;
virtual void handleFeatures(const QList<Feature>& features) = 0;
virtual void handleResponce(const QVariantMap& feature) = 0;

@ -1,4 +1,4 @@
#include "iservice.h"
#include "IPService.h"
namespace Patronum {
IService::IService()

@ -1,4 +1,4 @@
#include "controller.h"
#include "PController.h"
#include "controllerprivate.h"
#include <QDateTime>
#include <QVariantMap>

@ -1,7 +1,7 @@
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include "Patronum_global.h"
#include "icontroller.h"
#include "IPController.h"
#include <qtservice.h>
namespace Patronum {

@ -1,4 +1,4 @@
#include "feature.h"
#include "PFeature.h"
#include <QDataStream>

@ -1,4 +1,4 @@
#include "service.h"
#include "PService.h"
namespace Patronum {

@ -1,12 +1,12 @@
#ifndef SERVICE_H
#define SERVICE_H
#include "Patronum_global.h"
#include "feature.h"
#include "iservice.h"
#include "localsocket.h"
#include "PFeature.h"
#include "IPService.h"
#include "package.h"
#include "serviceprivate.h"
#include <qtservice.h>
#include <quasarapp.h>
namespace Patronum {
@ -27,7 +27,7 @@ public:
*/
Service(int argc, char **argv, const QString &name)
: QtService<Application>(argc, argv, name) {
d_ptr = new ServicePrivate(name, nullptr, this);
d_ptr = new ServicePrivate(name, this);
}
// IService interface
@ -57,8 +57,20 @@ protected:
return d_ptr->sendCmdResult(result);
}
/**
* @brief createApplication default implementation create a Application object and parse argumnts.
* @param argc argumnts count
* @param argv list of argumnts
*/
void createApplication(int argc, char **argv) {
QuasarAppUtils::Params::parseParams(argc, argv);
QtService<Application>::createApplication(argc, argv);
}
private:
ServicePrivate *d_ptr = nullptr;
};
}

@ -1,5 +1,5 @@
#include "controllerprivate.h"
#include "icontroller.h"
#include "IPController.h"
#include "localsocket.h"
#include <quasarapp.h>
#include "package.h"

@ -1,6 +1,6 @@
#ifndef CONTROLLERPRIVATE_H
#define CONTROLLERPRIVATE_H
#include <feature.h>
#include <PFeature.h>
namespace Patronum {

@ -0,0 +1,4 @@
#ifndef DEFINES_H
#define DEFINES_H
#endif // DEFINES_H

@ -1 +0,0 @@
#include "icontroller.h"

@ -1,8 +1,8 @@
#ifndef PATRONUM_H
#define PATRONUM_H
#include "controller.h"
#include "service.h"
#include "PController.h"
#include "PService.h"
namespace Patronum {}
#endif // PATRONUM_H

@ -1,6 +1,6 @@
#include "serviceprivate.h"
#include "iservice.h"
#include "IPService.h"
#include "localsocket.h"
#include "package.h"
#include <quasarapp.h>

@ -1,7 +1,7 @@
#ifndef SERVICEPRIVATE_H
#define SERVICEPRIVATE_H
#include <QObject>
#include <feature.h>
#include <PFeature.h>
namespace Patronum {
@ -23,6 +23,7 @@ private:
private slots:
void handleReceve(QByteArray data);
};
}