提交 08b7ccdc 编写于 作者: 丁劲犇's avatar 丁劲犇 😸

Tested in Ubuntu 14.04

上级 8fbfa1fc
......@@ -5,7 +5,7 @@
#-------------------------------------------------
QT += core gui network sql
unix:QMAKE_CXXFLAGS += -std=c++11
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = ZoomPipeline_FuncSvr
......@@ -13,51 +13,51 @@ TEMPLATE = app
SOURCES += main.cpp\
zpmainframe.cpp \
network/zp_tcpserver.cpp \
network/zp_nettransthread.cpp \
network/zp_netlistenthread.cpp \
network/zp_net_threadpool.cpp \
pipeline/zp_pipeline.cpp \
smartlink/st_client_table.cpp \
pipeline/zp_plworkingthread.cpp \
pipeline/zp_pltaskbase.cpp \
database/databaseresource.cpp \
smartlink/st_clientnode_basetrans.cpp \
smartlink/st_clientnode_app_imp.cpp \
smartlink/st_clientnode_applayer.cpp \
cluster/zp_clusterterm.cpp \
dialogaddressinput.cpp \
cluster/zp_clusternode.cpp \
smartlink/st_cross_svr_node.cpp
zpmainframe.cpp \
network/zp_tcpserver.cpp \
network/zp_nettransthread.cpp \
network/zp_netlistenthread.cpp \
network/zp_net_threadpool.cpp \
pipeline/zp_pipeline.cpp \
smartlink/st_client_table.cpp \
pipeline/zp_plworkingthread.cpp \
pipeline/zp_pltaskbase.cpp \
database/databaseresource.cpp \
smartlink/st_clientnode_basetrans.cpp \
smartlink/st_clientnode_app_imp.cpp \
smartlink/st_clientnode_applayer.cpp \
cluster/zp_clusterterm.cpp \
dialogaddressinput.cpp \
cluster/zp_clusternode.cpp \
smartlink/st_cross_svr_node.cpp
HEADERS += zpmainframe.h \
network/zp_tcpserver.h \
network/zp_nettransthread.h \
network/zp_netlistenthread.h \
network/zp_net_threadpool.h \
pipeline/zp_pipeline.h \
smartlink/st_client_table.h \
pipeline/zp_plworkingthread.h \
smartlink/st_message.h \
pipeline/zp_pltaskbase.h \
database/databaseresource.h \
smartlink/st_msg_applayer.h \
smartlink/st_clientnode_basetrans.h \
smartlink/st_clientnode_applayer.h \
cluster/zp_clusterterm.h \
cluster/cross_svr_messages.h \
dialogaddressinput.h \
cluster/zp_clusternode.h \
smartlink/st_cross_svr_msg.h \
smartlink/st_cross_svr_node.h
network/zp_tcpserver.h \
network/zp_nettransthread.h \
network/zp_netlistenthread.h \
network/zp_net_threadpool.h \
pipeline/zp_pipeline.h \
smartlink/st_client_table.h \
pipeline/zp_plworkingthread.h \
smartlink/st_message.h \
pipeline/zp_pltaskbase.h \
database/databaseresource.h \
smartlink/st_msg_applayer.h \
smartlink/st_clientnode_basetrans.h \
smartlink/st_clientnode_applayer.h \
cluster/zp_clusterterm.h \
cluster/cross_svr_messages.h \
dialogaddressinput.h \
cluster/zp_clusternode.h \
smartlink/st_cross_svr_msg.h \
smartlink/st_cross_svr_node.h
FORMS += zpmainframe.ui \
dialogaddressinput.ui
dialogaddressinput.ui
RESOURCES += \
resource.qrc
resource.qrc
OTHER_FILES += \
ZoomPipeline_FuncSvr_zh_CN.ts
ZoomPipeline_FuncSvr_zh_CN.ts
#include "st_client_table.h"
#include "st_clientnode_applayer.h"
#include <assert.h>
#include "st_cross_svr_node.h"
#include <functional>
namespace SmartLink{
using namespace std::placeholders;
st_client_table::st_client_table(
ZPNetwork::zp_net_Engine * NetEngine,
ZPTaskEngine::zp_pipeline * taskeng,
......@@ -25,8 +28,11 @@ namespace SmartLink{
connect (m_pCluster,&ZP_Cluster::zp_ClusterTerm::evt_NewSvrDisconnected,this,&st_client_table::on_evt_NewSvrDisconnected,Qt::QueuedConnection);
connect (m_pCluster,&ZP_Cluster::zp_ClusterTerm::evt_RemoteData_recieved,this,&st_client_table::on_evt_RemoteData_recieved,Qt::QueuedConnection);
connect (m_pCluster,&ZP_Cluster::zp_ClusterTerm::evt_RemoteData_transferred,this,&st_client_table::on_evt_RemoteData_transferred,Qt::QueuedConnection);
Reg_st_cross_svr_node(m_pCluster);
m_pCluster->SetNodeFactory(
std::bind(&st_client_table::cross_svr_node_factory,
this,
_1,_2,_3)
);
}
int st_client_table::heartBeatingThrd()
......@@ -290,6 +296,14 @@ namespace SmartLink{
{
}
ZP_Cluster::zp_ClusterNode * st_client_table::cross_svr_node_factory(
ZP_Cluster::zp_ClusterTerm * pTerm,
QObject * psock,
QObject * parent)
{
st_cross_svr_node * pNode = new st_cross_svr_node(pTerm,psock,parent);
pNode->setClientTable(this);
return pNode;
}
}
......@@ -5,7 +5,7 @@
#include <QList>
#include <QMutex>
#include <QMap>
#include <hash_map>
#include <unordered_map>
#include "../network/zp_net_threadpool.h"
#include "../pipeline/zp_pipeline.h"
#include "./st_message.h"
......@@ -26,6 +26,7 @@ namespace SmartLink{
,QObject *parent = 0);
~st_client_table();
bool regisitClientUUID(st_clientNode_baseTrans *);
st_clientNode_baseTrans * clientNodeFromUUID(quint32);
st_clientNode_baseTrans * clientNodeFromSocket(QObject *);
......@@ -70,8 +71,12 @@ namespace SmartLink{
QString m_largeFileFolder;
//cluster Nodes Map
std::hash_map<quint32,QString> m_hash_remoteClient2SvrName;
std::unordered_map<quint32,QString> m_hash_remoteClient2SvrName;
//Cluster Node Factory
ZP_Cluster::zp_ClusterNode * cross_svr_node_factory(
ZP_Cluster::zp_ClusterTerm * /*pTerm*/,
QObject * /*psock*/,
QObject * /*parent*/);
signals:
......
#include "st_cross_svr_node.h"
#include "../cluster/zp_clusterterm.h"
#include "st_client_table.h"
namespace SmartLink{
ZP_Cluster::zp_ClusterNode * st_cross_svr_node_factory(
ZP_Cluster::zp_ClusterTerm * pTerm,
QObject * psock,
QObject * parent)
{
return new st_cross_svr_node(pTerm,psock,parent);
}
void Reg_st_cross_svr_node(ZP_Cluster::zp_ClusterTerm *pTerm )
{
pTerm->SetNodeFactory(st_cross_svr_node_factory);
}
st_cross_svr_node::st_cross_svr_node(ZP_Cluster::zp_ClusterTerm * pTerm, QObject * psock,QObject *parent)
:ZP_Cluster::zp_ClusterNode(pTerm,psock,parent)
......@@ -22,5 +11,9 @@ namespace SmartLink{
{
return ZP_Cluster::zp_ClusterNode::deal_user_data(array);
}
void st_cross_svr_node::setClientTable(st_client_table * table)
{
this->m_pClientTable = table;
}
}
......@@ -2,22 +2,18 @@
#define ST_CROSS_SVR_NODE_H
#include "../cluster/zp_clusternode.h"
namespace SmartLink{
ZP_Cluster::zp_ClusterNode * st_cross_svr_node_factory(
ZP_Cluster::zp_ClusterTerm * /*pTerm*/,
QObject * /*psock*/,
QObject * /*parent*/);
void Reg_st_cross_svr_node(ZP_Cluster::zp_ClusterTerm *pTerm );
class st_client_table;
class st_cross_svr_node : public ZP_Cluster::zp_ClusterNode
{
Q_OBJECT
public:
st_cross_svr_node(ZP_Cluster::zp_ClusterTerm * pTerm, QObject * psock,QObject *parent);
void setClientTable(st_client_table * table);
protected:
//!virtual functions, dealing with the user-defined operations.
virtual bool deal_user_data(const QByteArray &);
protected:
st_client_table * m_pClientTable;
};
}
#endif // ST_CROSS_SVR_NODE_H
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册