提交 3a8660d0 编写于 作者: 丁劲犇's avatar 丁劲犇 😸

Add little funcs

上级 1a00ce7f
......@@ -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);
};
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册