From 82dc2e2e96807965ea6061c0da973b5313195608 Mon Sep 17 00:00:00 2001 From: Bryan Duxbury Date: Tue, 28 Jun 2011 17:43:30 +0000 Subject: [PATCH] THRIFT-1221. cpp: Remove SimpleCallback.h This file was unused. Patch: Diwaker Gupta git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1140746 13f79535-47bb-0310-9956-ffa450edef68 --- lib/cpp/Makefile.am | 3 +- lib/cpp/src/async/SimpleCallback.h | 98 ------------------------------ 2 files changed, 1 insertion(+), 100 deletions(-) delete mode 100644 lib/cpp/src/async/SimpleCallback.h diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am index b085ac40..253b68e8 100644 --- a/lib/cpp/Makefile.am +++ b/lib/cpp/Makefile.am @@ -163,8 +163,7 @@ include_async_HEADERS = \ src/async/TAsyncBufferProcessor.h \ src/async/TAsyncProtocolProcessor.h \ src/async/TEvhttpClientChannel.h \ - src/async/TEvhttpServer.h \ - src/async/SimpleCallback.h + src/async/TEvhttpServer.h noinst_PROGRAMS = concurrency_test diff --git a/lib/cpp/src/async/SimpleCallback.h b/lib/cpp/src/async/SimpleCallback.h deleted file mode 100644 index 4218328d..00000000 --- a/lib/cpp/src/async/SimpleCallback.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef _THRIFT_ASYNC_SIMPLECALLBACK_H_ -#define _THRIFT_ASYNC_SIMPLECALLBACK_H_ 1 - -#include -namespace apache { namespace thrift { - -/** - * A template class for forming simple method callbacks with either an empty - * argument list or one argument of known type. - * - * For more efficiency where tr1::function is overkill. - */ - -template ///< type of return value -class SimpleCallback { - typedef R (C::*cfptr_t)(A); ///< pointer-to-member-function type - cfptr_t fptr_; ///< the embedded function pointer - C* obj_; ///< object whose function we're wrapping - public: - /** - * Constructor for empty callback object. - */ - SimpleCallback() : - fptr_(NULL), obj_(NULL) {} - /** - * Construct callback wrapper for member function. - * - * @param fptr pointer-to-member-function - * @param "this" for object associated with callback - */ - SimpleCallback(cfptr_t fptr, const C* obj) : - fptr_(fptr), obj_(const_cast(obj)) - {} - - /** - * Make a call to the member function we've wrapped. - * - * @param i argument for the wrapped member function - * @return value from that function - */ - R operator()(A i) const { - (obj_->*fptr_)(i); - } - - operator bool() const { - return obj_ != NULL && fptr_ != NULL; - } - - ~SimpleCallback() {} -}; - -/** - * Specialization of SimpleCallback for empty argument list. - */ -template ///< type of return value -class SimpleCallback { - typedef R (C::*cfptr_t)(); ///< pointer-to-member-function type - cfptr_t fptr_; ///< the embedded function pointer - C* obj_; ///< object whose function we're wrapping - public: - /** - * Constructor for empty callback object. - */ - SimpleCallback() : - fptr_(NULL), obj_(NULL) {} - - /** - * Construct callback wrapper for member function. - * - * @param fptr pointer-to-member-function - * @param obj "this" for object associated with callback - */ - SimpleCallback(cfptr_t fptr, const C* obj) : - fptr_(fptr), obj_(const_cast(obj)) - {} - - /** - * Make a call to the member function we've wrapped. - * - * @return value from that function - */ - R operator()() const { - (obj_->*fptr_)(); - } - - operator bool() const { - return obj_ != NULL && fptr_ != NULL; - } - - ~SimpleCallback() {} -}; - -}} // apache::thrift - -#endif /* !_THRIFT_ASYNC_SIMPLECALLBACK_H_ */ -- 2.17.1