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
diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am
index b085ac4..253b68e 100644
--- a/lib/cpp/Makefile.am
+++ b/lib/cpp/Makefile.am
@@ -163,8 +163,7 @@
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 4218328..0000000
--- 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 <Thrift.h>
-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<typename C, ///< class whose method we wish to wrap
- typename A = void, ///< type of argument
- typename R = void> ///< 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<C*>(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<typename C, ///< class whose method we wish to wrap
- typename R> ///< type of return value
-class SimpleCallback<C, void, R> {
- 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<C*>(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_ */