single instance log & add global broadcast

This commit is contained in:
王劲鹏 2021-06-07 18:12:31 +08:00 committed by osborn
parent bb48faaf47
commit 4c3b5b1278
8 changed files with 32 additions and 7 deletions

View File

@ -10,9 +10,9 @@
class DORIC_EXPORT DoricContextManager {
private:
static DoricContextManager *local_instance;
DoricContextManager() {}
DoricContextManager() { qDebug() << "DoricContextManager constructor"; }
~DoricContextManager() {}
~DoricContextManager() { qDebug() << "DoricContextManager destructor"; }
QAtomicInt *counter = new QAtomicInt();
QMap<QString, DoricContext *> *contextMap =

View File

@ -11,9 +11,9 @@
class DORIC_EXPORT DoricNativeDriver : public DoricInterfaceDriver {
private:
static DoricNativeDriver *local_instance;
DoricNativeDriver() {}
DoricNativeDriver() { qDebug() << "DoricNativeDriver constructor"; }
~DoricNativeDriver() {}
~DoricNativeDriver() { qDebug() << "DoricNativeDriver destructor"; }
DoricJSEngine jsEngine;

View File

@ -22,6 +22,8 @@
#include "shader/slider/DoricSliderNode.h"
DoricRegistry::DoricRegistry() {
qDebug() << "DoricRegistry constructor";
registerNativePlugin<DoricShaderPlugin>("shader");
registerNativePlugin<DoricModalPlugin>("modal");
registerNativePlugin<DoricPopoverPlugin>("popover");

View File

@ -14,7 +14,7 @@ class DORIC_EXPORT DoricRegistry {
private:
static DoricRegistry *local_instance;
~DoricRegistry() { qDebug() << "destructor"; }
~DoricRegistry() { qDebug() << "DoricRegistry destructor"; }
public:
static DoricRegistry *getInstance() {

View File

@ -62,6 +62,7 @@ SOURCES += \
utils/DoricContextHolder.cpp \
utils/DoricDialogBridge.cpp \
utils/DoricDraggableBridge.cpp \
utils/DoricGlobalBroadcast.cpp \
utils/DoricImageBridge.cpp \
utils/DoricInputBridge.cpp \
utils/DoricLayouts.cpp \
@ -151,6 +152,7 @@ HEADERS += \
utils/DoricCountDownLatch.h \
utils/DoricDialogBridge.h \
utils/DoricDraggableBridge.h \
utils/DoricGlobalBroadcast.h \
utils/DoricImageBridge.h \
utils/DoricInputBridge.h \
utils/DoricLayouts.h \

View File

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

View File

@ -0,0 +1,20 @@
#ifndef DORICGLOBALBROADCAST_H
#define DORICGLOBALBROADCAST_H
#include <QDebug>
class DoricGlobalBroadcast {
private:
static DoricGlobalBroadcast *local_instance;
DoricGlobalBroadcast() { qDebug() << "DoricGlobalBroadcast constructor"; }
~DoricGlobalBroadcast() { qDebug() << "DoricGlobalBroadcast destructor"; }
public:
static DoricGlobalBroadcast *getInstance() {
static DoricGlobalBroadcast instance;
return &instance;
}
};
#endif // DORICGLOBALBROADCAST_H

View File

@ -70,11 +70,11 @@ private:
static DoricNetworkService *local_instance;
DoricNetworkService() {
qDebug() << "constructor";
qDebug() << "DoricNetworkService constructor";
thread.start();
}
~DoricNetworkService() { qDebug() << "destructor"; }
~DoricNetworkService() { qDebug() << "DoricNetworkService destructor"; }
public:
static DoricNetworkService *getInstance() {