init code
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#include "CServerManager.h"
|
||||
|
||||
using namespace NS_QGobangServer;
|
||||
|
||||
CServerManager* CServerManager::m_pInstance = nullptr;
|
||||
|
||||
CServerManager *CServerManager::getInstance()
|
||||
{
|
||||
if(m_pInstance == nullptr)
|
||||
{
|
||||
m_pInstance = new CServerManager();
|
||||
}
|
||||
|
||||
return m_pInstance;
|
||||
}
|
||||
|
||||
CServerManager::CServerManager()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef CSERVERMANAGER_H
|
||||
#define CSERVERMANAGER_H
|
||||
|
||||
/***************************************************************
|
||||
* @file CServerManager.h
|
||||
* @author Art_Sakura
|
||||
* @date 2025-07-24
|
||||
* @brief 项目由单例设计模式控制, 该类是控制全部服务端父类的单例类
|
||||
* 所有父类都应创建声明在此处, 方便统一管理
|
||||
***************************************************************/
|
||||
|
||||
namespace NS_QGobangServer
|
||||
|
||||
class CServerManager
|
||||
{
|
||||
public:
|
||||
static CServerManager *getInstance();
|
||||
|
||||
private:
|
||||
CServerManager();
|
||||
|
||||
private:
|
||||
static CServerManager *m_pInstance;
|
||||
|
||||
};
|
||||
|
||||
#endif // CSERVERMANAGER_H
|
||||
@@ -0,0 +1,20 @@
|
||||
QT = core
|
||||
|
||||
OBJECTS_DIR = $$PWD/../build/$$TARGET/obj
|
||||
MOC_DIR = $$PWD/../build/$$TARGET/moc
|
||||
RCC_DIR = $$PWD/../build/$$TARGET/rcc
|
||||
UI_DIR = $$PWD/../build/$$TARGET/ui
|
||||
|
||||
CONFIG += c++17 cmdline
|
||||
CONFIG -= debug_and_release debug_and_release_target
|
||||
|
||||
SOURCES += \
|
||||
CServerManager.cpp \
|
||||
main.cpp
|
||||
|
||||
#引用QGobangTool库文件
|
||||
INCLUDEPATH += ../QGobangTool/include
|
||||
LIBS += -L$$OUT_PWD/../QGobangTool/lib -lQGobangTool
|
||||
|
||||
HEADERS += \
|
||||
CServerManager.h
|
||||
@@ -0,0 +1,19 @@
|
||||
#include <QCoreApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
|
||||
// Set up code that uses the Qt event loop here.
|
||||
// Call a.quit() or a.exit() to quit the application.
|
||||
// A not very useful example would be including
|
||||
// #include <QTimer>
|
||||
// near the top of the file and calling
|
||||
// QTimer::singleShot(5000, &a, &QCoreApplication::quit);
|
||||
// which quits the application after 5 seconds.
|
||||
|
||||
// If you do not need a running Qt event loop, remove the call
|
||||
// to a.exec() or use the Non-Qt Plain C++ Application template.
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user