From 3a8660d055de1f8e8fb3c007fbe868cecf5c0202 Mon Sep 17 00:00:00 2001 From: goldenhawking Date: Wed, 12 Mar 2014 13:34:42 +0800 Subject: [PATCH] Add little funcs --- ZoomPipeline_FuncSvr/cluster/zp_clusterterm.h | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/ZoomPipeline_FuncSvr/cluster/zp_clusterterm.h b/ZoomPipeline_FuncSvr/cluster/zp_clusterterm.h index 8fa4847..4176446 100644 --- a/ZoomPipeline_FuncSvr/cluster/zp_clusterterm.h +++ b/ZoomPipeline_FuncSvr/cluster/zp_clusterterm.h @@ -12,31 +12,26 @@ namespace ZP_Cluster{ //! communicate with each other. class zp_ClusterTerm : public QObject { - Q_OBJECT + Q_OBJECT public: - explicit zp_ClusterTerm(const QString & name,int nTransThreads = 4,int nWorkingThreads = 4,QObject *parent = 0); - //cluster status - bool isListening(){ return m_pClusterNet->ListenerNames().size()==0?false:true;} - const QString & name() {return m_strTermName;} - int transThreads(){ return m_pClusterNet->TransThreadNum(); } - int transClients(int idx){ return m_pClusterNet->totalClients(idx);} - int payload(){ return m_pClusterEng->payload();} - int threadsCount(){ return m_pClusterEng->threadsCount();} - int threadsIdel(){ return m_pClusterEng->idleThreads();} - bool canExit(); + explicit zp_ClusterTerm(const QString & name,int nTransThreads = 4,int nWorkingThreads = 4,QObject *parent = 0); + //cluster status + ZPNetwork::zp_net_ThreadPool * netEng() {return m_pClusterNet;} + ZPTaskEngine::zp_pipeline * taskEng() {return m_pClusterEng;} + bool canExit(); protected: - QString m_strTermName;//the Terminal's name - ZPNetwork::zp_net_ThreadPool * m_pClusterNet; - ZPTaskEngine::zp_pipeline * m_pClusterEng; + QString m_strTermName;//the Terminal's name + ZPNetwork::zp_net_ThreadPool * m_pClusterNet; + ZPTaskEngine::zp_pipeline * m_pClusterEng; signals: public slots: - //!Start listen, this term can be connected by newly joined terms in future. - void StartListen(const QHostAddress &addr, int nPort); - //!Join cluster, using existing term (addr:nPort) - //!as soon as connection established, more existing terms will be sent to this term, - //!an p2p connection will start - bool JoinCluster(const QHostAddress &addr, int nPort); + //!Start listen, this term can be connected by newly joined terms in future. + void StartListen(const QHostAddress &addr, int nPort); + //!Join cluster, using existing term (addr:nPort) + //!as soon as connection established, more existing terms will be sent to this term, + //!an p2p connection will start + bool JoinCluster(const QHostAddress &addr, int nPort); }; } -- GitLab