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.2 1999-01-28 13:08:39 adam
8 * Yaz_PDU_Assoc better encapsulated. Memory leak fix in
9 * yaz-socket-manager.cc.
11 * Revision 1.1.1.1 1999/01/28 09:41:07 adam
12 * First implementation of YAZ++.
19 #include <yaz-pdu-observer.h>
21 /** Information Retrieval Assocation.
22 This object implements the client - and server role of a generic
25 class Yaz_IR_Assoc : public IYaz_PDU_Observer {
27 /// Create object using the PDU Observer specified
28 Yaz_IR_Assoc(IYaz_PDU_Observable *the_PDU_Observable);
29 /// Destroy assocation and close PDU Observer
30 virtual ~Yaz_IR_Assoc();
32 void recv_PDU(const char *buf, int len);
33 /// Connect notification
35 /// Failure notification
37 /// Begin Z39.50 client role
38 void client(const char *addr);
39 /// Begin Z39.50 server role
40 void server(const char *addr);
41 /// Decode Z39.50 PDU.
42 Z_APDU *decode_Z_PDU(const char *buf, int len);
43 /// Encode Z39.50 PDU.
44 int encode_Z_PDU(Z_APDU *apdu, char **buf, int *len);
46 int send_Z_PDU(Z_APDU *apdu);
47 /// Receive Z39.50 PDU
48 virtual void recv_Z_PDU (Z_APDU *apdu) = 0;
49 /// Create Z39.50 with reasonable defaults
50 Z_APDU *create_Z_PDU(int type);
52 IYaz_PDU_Observable *m_PDU_Observable;