diff options
author | Craig Tiller <ctiller@google.com> | 2015-06-08 10:34:15 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-06-08 10:34:15 -0700 |
commit | cfef24bb56b00c7c1c8b39c007bf2e5a6bac2d65 (patch) | |
tree | 8ffe88a0894a6468ab2f64dff1d8c6561370ff52 /include | |
parent | 571af49aaf8a0e5e5cd7cf433f7e0b00e20e7c5c (diff) | |
parent | b32c082906b9b52b89387761c3f7cb01638bcadc (diff) |
Merge github.com:grpc/grpc into we-dont-need-no-backup
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc++/config.h | 24 | ||||
-rw-r--r-- | include/grpc++/time.h | 16 |
2 files changed, 16 insertions, 24 deletions
diff --git a/include/grpc++/config.h b/include/grpc++/config.h index ca74064be2..55b2a64482 100644 --- a/include/grpc++/config.h +++ b/include/grpc++/config.h @@ -46,7 +46,7 @@ #define GRPC_CXX0X_NO_OVERRIDE 1 #define GRPC_CXX0X_NO_CHRONO 1 #define GRPC_CXX0X_NO_THREAD 1 -#endif +#endif #endif // Visual Studio #ifndef __clang__ @@ -99,28 +99,24 @@ ::google::protobuf::io::ZeroCopyOutputStream #define GRPC_CUSTOM_ZEROCOPYINPUTSTREAM \ ::google::protobuf::io::ZeroCopyInputStream -#define GRPC_CUSTOM_CODEDINPUTSTREAM ::google::protobuf::io::CodedInputStream +#define GRPC_CUSTOM_CODEDINPUTSTREAM \ + ::google::protobuf::io::CodedInputStream #endif + #ifdef GRPC_CXX0X_NO_NULLPTR #include <memory> const class { - public: - template <class T> - operator T *() const { - return static_cast<T *>(0); - } - template <class T> - operator std::unique_ptr<T>() const { +public: + template <class T> operator T*() const {return static_cast<T *>(0);} + template <class T> operator std::unique_ptr<T>() const { return std::unique_ptr<T>(static_cast<T *>(0)); } - template <class T> - operator std::shared_ptr<T>() const { + template <class T> operator std::shared_ptr<T>() const { return std::shared_ptr<T>(static_cast<T *>(0)); } - operator bool() const { return false; } - - private: + operator bool() const {return false;} +private: void operator&() const = delete; } nullptr = {}; #endif diff --git a/include/grpc++/time.h b/include/grpc++/time.h index 8fb2f8505c..f9b2ce5cab 100644 --- a/include/grpc++/time.h +++ b/include/grpc++/time.h @@ -52,22 +52,22 @@ namespace grpc { template <typename T> class TimePoint { public: - TimePoint(const T& time) { you_need_a_specialization_of_TimePoint(); } + TimePoint(const T& time) { + you_need_a_specialization_of_TimePoint(); + } gpr_timespec raw_time() { gpr_timespec t; return t; } - private: void you_need_a_specialization_of_TimePoint(); }; -template <> +template<> class TimePoint<gpr_timespec> { public: - TimePoint(const gpr_timespec& time) : time_(time) {} + TimePoint(const gpr_timespec& time) : time_(time) { } gpr_timespec raw_time() { return time_; } - private: gpr_timespec time_; }; @@ -85,9 +85,6 @@ namespace grpc { // from and to should be absolute time. void Timepoint2Timespec(const std::chrono::system_clock::time_point& from, gpr_timespec* to); -void TimepointHR2Timespec( - const std::chrono::high_resolution_clock::time_point& from, - gpr_timespec* to); std::chrono::system_clock::time_point Timespec2Timepoint(gpr_timespec t); @@ -95,10 +92,9 @@ template <> class TimePoint<std::chrono::system_clock::time_point> { public: TimePoint(const std::chrono::system_clock::time_point& time) { - Timepoint2Timespec(time, &time_); + Timepoint2Timespec(time, &time_); } gpr_timespec raw_time() const { return time_; } - private: gpr_timespec time_; }; |