Show -V option in usage message.
[yazproxy-moved-to-github.git] / src / msg-thread.h
1 /* This file is part of YAZ proxy
2    Copyright (C) 1998-2008 Index Data
3
4 YAZ proxy is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8
9 YAZ proxy is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17 */
18
19 #include <yazpp/socket-observer.h>
20 #include <yaz/yconfig.h>
21
22 class YAZ_EXPORT IMsg_Thread {
23 public:
24     virtual IMsg_Thread *handle() = 0;
25     virtual void result() = 0;
26     virtual ~IMsg_Thread();
27 };
28
29 class YAZ_EXPORT Msg_Thread_Queue_List {
30     friend class Msg_Thread_Queue;
31  private:
32     IMsg_Thread *m_item;
33     Msg_Thread_Queue_List *m_next;
34 };
35
36 class YAZ_EXPORT Msg_Thread_Queue {
37  public:
38     Msg_Thread_Queue();
39     void enqueue(IMsg_Thread *in);
40     IMsg_Thread *dequeue();
41     int size();
42  private:
43     Msg_Thread_Queue_List *m_list;
44 };
45
46 class YAZ_EXPORT Msg_Thread : public yazpp_1::ISocketObserver {
47     class Private;
48  public:
49     Msg_Thread(yazpp_1::ISocketObservable *obs, int no_threads);
50     virtual ~Msg_Thread();
51     void socketNotify(int event);
52     void put(IMsg_Thread *m);
53     IMsg_Thread *get();
54     void run(void *p);
55 private:
56     class Private *m_p;
57 };
58
59 /*
60  * Local variables:
61  * c-basic-offset: 4
62  * indent-tabs-mode: nil
63  * End:
64  * vim: shiftwidth=4 tabstop=8 expandtab
65  */
66