Add LICENSE file and Refer to it from the source. Include license material
[metaproxy-moved-to-github.git] / src / thread_pool_observer.hpp
1 /* $Id: thread_pool_observer.hpp,v 1.10 2006-06-10 14:29:13 adam Exp $
2    Copyright (c) 2005-2006, Index Data.
3
4    See the LICENSE file for details
5  */
6
7 #ifndef YP2_THREAD_POOL_OBSERVER_HPP
8 #define YP2_THREAD_POOL_OBSERVER_HPP
9
10 #include <boost/scoped_ptr.hpp>
11
12 #include <yazpp/socket-observer.h>
13 #include <yaz/yconfig.h>
14
15 namespace metaproxy_1 {
16     class IThreadPoolMsg {
17     public:
18         virtual IThreadPoolMsg *handle() = 0;
19         virtual void result() = 0;
20         virtual ~IThreadPoolMsg();
21     };
22
23     class ThreadPoolSocketObserver : public yazpp_1::ISocketObserver {
24         class Rep;
25         class Worker;
26     public:
27         ThreadPoolSocketObserver(yazpp_1::ISocketObservable *obs,
28                                  int no_threads);
29         virtual ~ThreadPoolSocketObserver();
30         void put(IThreadPoolMsg *m);
31         IThreadPoolMsg *get();
32         void run(void *p);
33     private:
34         void socketNotify(int event);
35         boost::scoped_ptr<Rep> m_p;
36
37     };
38 }
39 #endif
40 /*
41  * Local variables:
42  * c-basic-offset: 4
43  * indent-tabs-mode: nil
44  * c-file-style: "stroustrup"
45  * End:
46  * vim: shiftwidth=4 tabstop=8 expandtab
47  */
48