From 8ebe1a2bcb6bec3d8c4b4077b4c85830d9398c5d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 22 Sep 2005 12:40:45 +0000 Subject: [PATCH] Added pure virtual destructors for interface-like classes. --- include/yaz++/pdu-observer.h | 8 +++++++- include/yaz++/query.h | 11 ++++++++++- include/yaz++/socket-observer.h | 4 +++- include/yaz++/z-server.h | 6 +++++- src/Makefile.am | 6 ++++-- src/pdu-observer.cpp | 28 ++++++++++++++++++++++++++++ src/query.cpp | 23 +++++++++++++++++++++++ src/socket-observer.cpp | 28 ++++++++++++++++++++++++++++ src/z-server.cpp | 29 +++++++++++++++++++++++++++++ zlint/zlint.cpp | 7 ++++++- zlint/zlint.h | 5 +++-- 11 files changed, 146 insertions(+), 9 deletions(-) create mode 100644 src/pdu-observer.cpp create mode 100644 src/query.cpp create mode 100644 src/socket-observer.cpp create mode 100644 src/z-server.cpp diff --git a/include/yaz++/pdu-observer.h b/include/yaz++/pdu-observer.h index 3a0627a..2b90a8b 100644 --- a/include/yaz++/pdu-observer.h +++ b/include/yaz++/pdu-observer.h @@ -2,12 +2,14 @@ * Copyright (c) 1998-2005, Index Data. * See the file LICENSE for details. * - * $Id: pdu-observer.h,v 1.7 2005-06-25 15:53:19 adam Exp $ + * $Id: pdu-observer.h,v 1.8 2005-09-22 12:40:45 adam Exp $ */ #ifndef YAZ_PDU_OBSERVER_H #define YAZ_PDU_OBSERVER_H +#include + namespace yazpp_1 { class IPDU_Observer; @@ -36,6 +38,8 @@ class YAZ_EXPORT IPDU_Observable { virtual void idleTime (int timeout) = 0; /// Get peername virtual const char *getpeername() = 0; + + virtual ~IPDU_Observable() = 0; }; /** Protocol Data Unit Observer. @@ -55,6 +59,8 @@ class YAZ_EXPORT IPDU_Observer { /// Make clone of observer using IPDU_Observable interface virtual IPDU_Observer *sessionNotify( IPDU_Observable *the_PDU_Observable, int fd) = 0; + + virtual ~IPDU_Observer() = 0; }; }; diff --git a/include/yaz++/query.h b/include/yaz++/query.h index af4f7e0..7ec2f4d 100644 --- a/include/yaz++/query.h +++ b/include/yaz++/query.h @@ -2,9 +2,14 @@ * Copyright (c) 1998-2000, Index Data. * See the file LICENSE for details. * - * $Id: query.h,v 1.3 2005-06-25 15:53:19 adam Exp $ + * $Id: query.h,v 1.4 2005-09-22 12:40:45 adam Exp $ */ +#ifndef YAZ_PP_QUERY_H +#define YAZ_PP_QUERY_H + +#include + namespace yazpp_1 { /** Query Generic Query. @@ -13,8 +18,12 @@ class YAZ_EXPORT Yaz_Query { public: /// Print query in buffer described by str and len virtual void print (char *str, int len) = 0; + virtual ~Yaz_Query() = 0; }; }; + +#endif + /* * Local variables: * c-basic-offset: 4 diff --git a/include/yaz++/socket-observer.h b/include/yaz++/socket-observer.h index 34c5e31..bd2425c 100644 --- a/include/yaz++/socket-observer.h +++ b/include/yaz++/socket-observer.h @@ -2,7 +2,7 @@ * Copyright (c) 1998-2005, Index Data. * See the file LICENSE for details. * - * $Id: socket-observer.h,v 1.6 2005-06-25 15:53:19 adam Exp $ + * $Id: socket-observer.h,v 1.7 2005-09-22 12:40:45 adam Exp $ */ #ifndef YAZ_SOCKET_OBSERVER_H @@ -54,6 +54,7 @@ class YAZ_EXPORT ISocketObservable { /// Specify timeout virtual void timeoutObserver(ISocketObserver *observer, int timeout)=0; + virtual ~ISocketObservable() = 0; }; /** Socket Observer. @@ -65,6 +66,7 @@ class YAZ_EXPORT ISocketObserver { public: /// Notify the observer that something happened to socket virtual void socketNotify(int event) = 0; + virtual ~ISocketObserver() = 0; }; }; diff --git a/include/yaz++/z-server.h b/include/yaz++/z-server.h index f4e4ea4..cd42c38 100644 --- a/include/yaz++/z-server.h +++ b/include/yaz++/z-server.h @@ -2,7 +2,7 @@ * Copyright (c) 2000-2005, Index Data. * See the file LICENSE for details. * - * $Id: z-server.h,v 1.8 2005-06-25 15:53:19 adam Exp $ + * $Id: z-server.h,v 1.9 2005-09-22 12:40:45 adam Exp $ */ #include @@ -26,6 +26,8 @@ class YAZ_EXPORT Z_ServerUtility { void Z_ServerUtility::create_diagnostics ( ODR odr, int error, const char *addinfo, Z_DiagRec ***dreca, int *num); + + virtual ~Z_ServerUtility() = 0; }; class YAZ_EXPORT IServer_Facility { @@ -34,6 +36,8 @@ class YAZ_EXPORT IServer_Facility { Z_InitRequest *initRequest, Z_InitResponse *initResponse) = 0; virtual int recv(Z_Server *server, Z_APDU *apdu) = 0; + + virtual ~IServer_Facility() = 0; }; class YAZ_EXPORT Yaz_Facility_ILL : public IServer_Facility { diff --git a/src/Makefile.am b/src/Makefile.am index c8e5aa1..e56d58a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.26 2005-06-21 17:37:15 adam Exp $ +## $Id: Makefile.am,v 1.27 2005-09-22 12:40:45 adam Exp $ AM_CXXFLAGS = -I$(srcdir)/../include $(YAZINC) @@ -7,7 +7,9 @@ libyazcpp_la_LDFLAGS=-version-info 1:0:0 DISTCLEANFILES = yaz++-config -libyazcpp_la_SOURCES=yaz-socket-manager.cpp yaz-pdu-assoc.cpp \ +libyazcpp_la_SOURCES=socket-observer.cpp pdu-observer.cpp query.cpp \ + z-server.cpp \ + yaz-socket-manager.cpp yaz-pdu-assoc.cpp \ yaz-z-assoc.cpp yaz-z-query.cpp yaz-ir-assoc.cpp \ yaz-z-server.cpp yaz-pdu-assoc-thread.cpp yaz-z-server-sr.cpp \ yaz-z-server-ill.cpp yaz-z-server-update.cpp yaz-z-databases.cpp \ diff --git a/src/pdu-observer.cpp b/src/pdu-observer.cpp new file mode 100644 index 0000000..bb9ad17 --- /dev/null +++ b/src/pdu-observer.cpp @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1998-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: pdu-observer.cpp,v 1.1 2005-09-22 12:40:45 adam Exp $ + */ + +#include + +using namespace yazpp_1; + +IPDU_Observable::~IPDU_Observable() +{ + +} + +IPDU_Observer::~IPDU_Observer() +{ + +} + +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ diff --git a/src/query.cpp b/src/query.cpp new file mode 100644 index 0000000..12ba858 --- /dev/null +++ b/src/query.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (c) 1998-2000, Index Data. + * See the file LICENSE for details. + * + * $Id: query.cpp,v 1.1 2005-09-22 12:40:45 adam Exp $ + */ + +#include + +using namespace yazpp_1; + +Yaz_Query::~Yaz_Query() +{ + +} + +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ diff --git a/src/socket-observer.cpp b/src/socket-observer.cpp new file mode 100644 index 0000000..ddd506a --- /dev/null +++ b/src/socket-observer.cpp @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1998-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: socket-observer.cpp,v 1.1 2005-09-22 12:40:45 adam Exp $ + */ + +#include + +using namespace yazpp_1; + +ISocketObservable::~ISocketObservable() +{ + +} + +ISocketObserver::~ISocketObserver() +{ + +} + +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ diff --git a/src/z-server.cpp b/src/z-server.cpp new file mode 100644 index 0000000..044baa8 --- /dev/null +++ b/src/z-server.cpp @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2000-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: z-server.cpp,v 1.1 2005-09-22 12:40:45 adam Exp $ + */ + +#include + +using namespace yazpp_1; + +Z_ServerUtility::~Z_ServerUtility() +{ + +} + +IServer_Facility::~IServer_Facility() +{ + +} + +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/zlint/zlint.cpp b/zlint/zlint.cpp index c8325e0..7a89a52 100644 --- a/zlint/zlint.cpp +++ b/zlint/zlint.cpp @@ -2,7 +2,7 @@ * Copyright (c) 2004, Index Data. * See the file LICENSE for details. * - * $Id: zlint.cpp,v 1.11 2005-06-25 15:53:21 adam Exp $ + * $Id: zlint.cpp,v 1.12 2005-09-22 12:40:45 adam Exp $ */ #include @@ -16,6 +16,11 @@ #include +Zlint_test::~Zlint_test() +{ + +} + class Zlint_t { public: friend class Zlint; diff --git a/zlint/zlint.h b/zlint/zlint.h index 8c0302a..7ee796b 100644 --- a/zlint/zlint.h +++ b/zlint/zlint.h @@ -1,8 +1,8 @@ /* - * Copyright (c) 2004, Index Data. + * Copyright (c) 2004-2005, Index Data. * See the file LICENSE for details. * - * $Id: zlint.h,v 1.4 2005-06-25 15:53:21 adam Exp $ + * $Id: zlint.h,v 1.5 2005-09-22 12:40:45 adam Exp $ */ #include @@ -51,6 +51,7 @@ public: virtual Zlint_code init(Zlint *z) = 0; virtual Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu) = 0; virtual Zlint_code recv_fail(Zlint *z, int reason) = 0; + virtual ~Zlint_test() = 0; }; class Zlint_test_simple : public Zlint_test { -- 1.7.10.4