2 * Copyright (c) 1998-1999, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
6 * $Log: yaz-ir-assoc.h,v $
7 * Revision 1.3 1999-02-02 14:01:12 adam
8 * First WIN32 port of YAZ++.
10 * Revision 1.2 1999/01/28 13:08:39 adam
11 * Yaz_PDU_Assoc better encapsulated. Memory leak fix in
12 * yaz-socket-manager.cc.
14 * Revision 1.1.1.1 1999/01/28 09:41:07 adam
15 * First implementation of YAZ++.
22 #include <yaz-pdu-observer.h>
24 /** Information Retrieval Assocation.
25 This object implements the client - and server role of a generic
28 class YAZ_EXPORT Yaz_IR_Assoc : public IYaz_PDU_Observer {
30 /// Create object using the PDU Observer specified
31 Yaz_IR_Assoc(IYaz_PDU_Observable *the_PDU_Observable);
32 /// Destroy assocation and close PDU Observer
33 virtual ~Yaz_IR_Assoc();
35 void recv_PDU(const char *buf, int len);
36 /// Connect notification
38 /// Failure notification
40 /// Begin Z39.50 client role
41 void client(const char *addr);
42 /// Begin Z39.50 server role
43 void server(const char *addr);
44 /// Decode Z39.50 PDU.
45 Z_APDU *decode_Z_PDU(const char *buf, int len);
46 /// Encode Z39.50 PDU.
47 int encode_Z_PDU(Z_APDU *apdu, char **buf, int *len);
49 int send_Z_PDU(Z_APDU *apdu);
50 /// Receive Z39.50 PDU
51 virtual void recv_Z_PDU (Z_APDU *apdu) = 0;
52 /// Create Z39.50 with reasonable defaults
53 Z_APDU *create_Z_PDU(int type);
54 static int yaz_init_flag;
55 static int yaz_init_func();
57 IYaz_PDU_Observable *m_PDU_Observable;