8 #ifndef TCPSERVERPOOL_H_
9 #define TCPSERVERPOOL_H_
14 #include <QtCore/QThread>
15 #include <QtCore/QSemaphore>
24 QSemaphore * sharedSemaphore,
25 int maxSemaphoreResources,
26 QObject * parent = 0) :
34 UASSERT(maxSemaphoreResources > 0);
41 UINFO(
"Thread %p detecting...", (
void *)this->thread());
52 UINFO(
"Thread %p adding object %d (%s)...", (
void *)this->thread(),
id, filePath.toStdString().c_str());
60 UINFO(
"Thread %p removing object %d...", (
void *)this->thread(),
id);
84 qRegisterMetaType<cv::Mat>(
"cv::Mat");
87 for(
int i=0; i<threads; ++i)
90 UINFO(
"TcpServer set on port: %d (IP=%s)",
99 connect(
threadPool_[i], SIGNAL(finished()), tcpServer, SLOT(deleteLater()));
100 connect(
threadPool_[i], SIGNAL(finished()), worker, SLOT(deleteLater()));
104 QObject::connect(tcpServer, SIGNAL(detectObject(
const cv::Mat &)), worker, SLOT(detect(
const cv::Mat &)));
105 QObject::connect(tcpServer, SIGNAL(addObject(
const cv::Mat &,
int,
const QString &)), worker, SLOT(addObjectAndUpdate(
const cv::Mat &,
int,
const QString &)));
106 QObject::connect(tcpServer, SIGNAL(removeObject(
int)), worker, SLOT(removeObjectAndUpdate(
int)));