rpc_define.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. Copyright (c) 2020 Sogou, Inc.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. #ifndef __RPC_DEFINE_H__
  14. #define __RPC_DEFINE_H__
  15. #if __cplusplus < 201100
  16. #error CPLUSPLUS VERSION required at least C++11. Please use "-std=c++11".
  17. #include <C++11_REQUIRED>
  18. #endif
  19. #include "rpc_server.h"
  20. #include "rpc_client.h"
  21. namespace srpc
  22. {
  23. using SRPCServer = RPCServer<RPCTYPESRPC>;
  24. using SRPCClient = RPCClient<RPCTYPESRPC>;
  25. using SRPCClientTask = SRPCClient::TASK;
  26. using SRPCHttpServer = RPCServer<RPCTYPESRPCHttp>;
  27. using SRPCHttpClient = RPCClient<RPCTYPESRPCHttp>;
  28. using SRPCHttpClientTask = SRPCHttpClient::TASK;
  29. using BRPCServer = RPCServer<RPCTYPEBRPC>;
  30. using BRPCClient = RPCClient<RPCTYPEBRPC>;
  31. using BRPCClientTask = BRPCClient::TASK;
  32. using ThriftServer = RPCServer<RPCTYPEThrift>;
  33. using ThriftClient = RPCClient<RPCTYPEThrift>;
  34. using ThriftClientTask = ThriftClient::TASK;
  35. using ThriftHttpServer = RPCServer<RPCTYPEThriftHttp>;
  36. using ThriftHttpClient = RPCClient<RPCTYPEThriftHttp>;
  37. using ThriftHttpClientTask = ThriftHttpClient::TASK;
  38. using TRPCServer = RPCServer<RPCTYPETRPC>;
  39. using TRPCClient = RPCClient<RPCTYPETRPC>;
  40. using TRPCClientTask = TRPCClient::TASK;
  41. using TRPCHttpServer = RPCServer<RPCTYPETRPCHttp>;
  42. using TRPCHttpClient = RPCClient<RPCTYPETRPCHttp>;
  43. using TRPCHttpClientTask = TRPCHttpClient::TASK;
  44. } // namespace srpc
  45. #endif