template <typename T> class threadpool;
class http_conn;
threadpool <http_conn> *poll;
请问类http_conn
和类threadpool
是什么关系,在uml中如何表示?threadpool
的定义如下:
template< typename T >
class threadpool
{
public:
threadpool( int thread_number = 8, int max_requests = 10000 );
~threadpool();
bool append( T* request );
private:
static void* worker( void* arg );
void run();
private:
int m_thread_number;
int m_max_requests;
pthread_t* m_threads;
std::list< T* > m_workqueue;
locker m_queuelocker;
sem m_queuestat;
bool m_stop;
};
建議你最好貼完整的類別聲明,目前來看http_conn可能是threadpool類別的一個成員。
感覺是 uni-directional association: