From a6f9d5cd07ea1b21641232312cc15adcce91f1ec Mon Sep 17 00:00:00 2001 From: Jelte Jansen Date: Fri, 28 Jan 2011 13:51:21 +0100 Subject: [trac494] moved extra callback layer to its own file --- src/lib/resolve/resolve.h | 62 ----------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 src/lib/resolve/resolve.h (limited to 'src/lib/resolve/resolve.h') diff --git a/src/lib/resolve/resolve.h b/src/lib/resolve/resolve.h deleted file mode 100644 index 9d23b46fcc..0000000000 --- a/src/lib/resolve/resolve.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. - -#ifndef _ISC_RESOLVE_H -#define _ISC_RESOLVE_H 1 - -#include - -namespace isc { -namespace resolve { - -// We define two types of callbackholders for processing recursive -// queries; one calls back the original DNSServer to resume() -// the other uses direct callbacks (for instance when we need to -// resolve something ourselves) -// Caller warning: only callback once! The objects will delete -// themselves on callback (after they have done they callback) -class AbstractResolverCallback { -public: - ~AbstractResolverCallback() {}; - virtual void callback(bool result) = 0; -}; - -class ResolverCallbackServer : public AbstractResolverCallback { -public: - ResolverCallbackServer(asiolink::DNSServer* server) : - server_(server->clone()) {} - void callback(bool result); - -private: - asiolink::DNSServer* server_; -}; - -class ResolverCallbackDirect : public AbstractResolverCallback { -public: - ResolverCallbackDirect( - const isc::resolve::ResolverInterface::CallbackPtr callback, - isc::dns::MessagePtr answer_message) : - callback_(callback), - answer_message_(answer_message) {} - void callback(bool result); - -private: - const isc::resolve::ResolverInterface::CallbackPtr callback_; - isc::dns::MessagePtr answer_message_; -}; - -} //namespace resolve -} //namespace isc - -#endif // ISC_RESOLVE_H_ -- cgit v1.2.3