summaryrefslogtreecommitdiff
path: root/tutorial/cpp
diff options
context:
space:
mode:
authorKonrad Grochowski <hcorg@apache.org>2014-11-13 15:33:38 +0100
committerKonrad Grochowski <hcorg@apache.org>2014-11-18 10:02:08 +0100
commit74260aa9099c3bb209bc8e524b0e8ba603f62c41 (patch)
tree07ff24e0bed1f74da57e56feb38ea6bae063629c /tutorial/cpp
parentca7e97e0423e785bd7a6b7b8400e67897975e7f6 (diff)
downloadthrift-74260aa9099c3bb209bc8e524b0e8ba603f62c41.tar.gz
THRIFT-2729: C++ - .clang-format created and applied
Client: C++ Patch: Konrad Grochowski make style command added
Diffstat (limited to 'tutorial/cpp')
-rw-r--r--tutorial/cpp/CppClient.cpp1
-rw-r--r--tutorial/cpp/CppServer.cpp19
-rwxr-xr-xtutorial/cpp/Makefile.am3
3 files changed, 8 insertions, 15 deletions
diff --git a/tutorial/cpp/CppClient.cpp b/tutorial/cpp/CppClient.cpp
index 44753383d..258cbd66d 100644
--- a/tutorial/cpp/CppClient.cpp
+++ b/tutorial/cpp/CppClient.cpp
@@ -76,5 +76,4 @@ int main() {
} catch (TException& tx) {
cout << "ERROR: " << tx.what() << endl;
}
-
}
diff --git a/tutorial/cpp/CppServer.cpp b/tutorial/cpp/CppServer.cpp
index 133d75d44..84b79d420 100644
--- a/tutorial/cpp/CppServer.cpp
+++ b/tutorial/cpp/CppServer.cpp
@@ -44,12 +44,10 @@ using namespace tutorial;
using namespace shared;
class CalculatorHandler : public CalculatorIf {
- public:
+public:
CalculatorHandler() {}
- void ping() {
- cout << "ping()" << endl;
- }
+ void ping() { cout << "ping()" << endl; }
int32_t add(const int32_t n1, const int32_t n2) {
cout << "add(" << n1 << ", " << n2 << ")" << endl;
@@ -95,18 +93,15 @@ class CalculatorHandler : public CalculatorIf {
return val;
}
- void getStruct(SharedStruct &ret, const int32_t logid) {
+ void getStruct(SharedStruct& ret, const int32_t logid) {
cout << "getStruct(" << logid << ")" << endl;
ret = log[logid];
}
- void zip() {
- cout << "zip()" << endl;
- }
+ void zip() { cout << "zip()" << endl; }
protected:
map<int32_t, SharedStruct> log;
-
};
int main() {
@@ -116,11 +111,7 @@ int main() {
boost::shared_ptr<TServerTransport> serverTransport(new TServerSocket(9090));
boost::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
- TSimpleServer server(processor,
- serverTransport,
- transportFactory,
- protocolFactory);
-
+ TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
/**
* Or you could do one of these
diff --git a/tutorial/cpp/Makefile.am b/tutorial/cpp/Makefile.am
index 9768c5189..3b382403c 100755
--- a/tutorial/cpp/Makefile.am
+++ b/tutorial/cpp/Makefile.am
@@ -76,6 +76,9 @@ tutorialserver: all
tutorialclient: all
./TutorialClient
+style-local:
+ $(CPPSTYLE_CMD)
+
EXTRA_DIST = \
CppClient.cpp \
CppServer.cpp