Revert "THRIFT-2729: C++ - .clang-format created and applied"
This reverts commit 74260aa9099c3bb209bc8e524b0e8ba603f62c41.
diff --git a/lib/cpp/test/processor/ServerThread.h b/lib/cpp/test/processor/ServerThread.h
index eed3469..f7fa0d5 100644
--- a/lib/cpp/test/processor/ServerThread.h
+++ b/lib/cpp/test/processor/ServerThread.h
@@ -26,15 +26,13 @@
#include "EventLog.h"
-namespace apache {
-namespace thrift {
-namespace test {
+namespace apache { namespace thrift { namespace test {
/**
* A helper class to tell ServerThread how to create the server
*/
class ServerState {
-public:
+ public:
virtual ~ServerState() {}
/**
@@ -52,7 +50,8 @@
* start serving traffic. It is invoked from the server thread, rather than
* the main thread.
*/
- virtual boost::shared_ptr<server::TServerEventHandler> getServerEventHandler() {
+ virtual boost::shared_ptr<server::TServerEventHandler>
+ getServerEventHandler() {
return boost::shared_ptr<server::TServerEventHandler>();
}
@@ -62,16 +61,17 @@
* Subclasses may override this method if they wish to record the final
* port that was used for the server.
*/
- virtual void bindSuccessful(uint16_t /*port*/) {}
+ virtual void bindSuccessful(uint16_t /*port*/) {
+ }
};
/**
* ServerThread starts a thrift server running in a separate thread.
*/
class ServerThread {
-public:
- ServerThread(const boost::shared_ptr<ServerState>& state, bool autoStart)
- : helper_(new Helper(this)),
+ public:
+ ServerThread(const boost::shared_ptr<ServerState>& state, bool autoStart) :
+ helper_(new Helper(this)),
port_(0),
running_(false),
serving_(false),
@@ -85,7 +85,9 @@
void start();
void stop();
- uint16_t getPort() const { return port_; }
+ uint16_t getPort() const {
+ return port_;
+ }
~ServerThread() {
if (running_) {
@@ -97,20 +99,26 @@
}
}
-protected:
+ protected:
// Annoying. thrift forces us to use shared_ptr, so we have to use
// a helper class that we can allocate on the heap and give to thrift.
// It would be simpler if we could just make Runnable and TServerEventHandler
// private base classes of ServerThread.
- class Helper : public concurrency::Runnable, public server::TServerEventHandler {
- public:
- Helper(ServerThread* serverThread) : serverThread_(serverThread) {}
+ class Helper : public concurrency::Runnable,
+ public server::TServerEventHandler {
+ public:
+ Helper(ServerThread* serverThread)
+ : serverThread_(serverThread) {}
- void run() { serverThread_->run(); }
+ void run() {
+ serverThread_->run();
+ }
- void preServe() { serverThread_->preServe(); }
+ void preServe() {
+ serverThread_->preServe();
+ }
- private:
+ private:
ServerThread* serverThread_;
};
@@ -129,8 +137,7 @@
boost::shared_ptr<server::TServer> server_;
boost::shared_ptr<concurrency::Thread> thread_;
};
-}
-}
-} // apache::thrift::test
+
+}}} // apache::thrift::test
#endif // _THRIFT_TEST_SERVERTHREAD_H_