34 #ifndef GRPCXX_SERVER_BUILDER_H
35 #define GRPCXX_SERVER_BUILDER_H
44 class AsyncGenericService;
45 class AsynchronousService;
46 class CompletionQueue;
49 class ServerCompletionQueue;
50 class ServerCredentials;
51 class SynchronousService;
52 class ThreadPoolInterface;
92 max_message_size_ = max_message_size;
97 std::shared_ptr<ServerCredentials> creds,
98 int* selected_port =
nullptr);
115 std::shared_ptr<ServerCredentials> creds;
119 typedef std::unique_ptr<grpc::string> HostString;
120 template <
class T>
struct NamedService {
121 explicit NamedService(T* s) : service(s) {}
123 : host(new grpc::
string(h)), service(s) {}
128 int max_message_size_;
129 std::vector<std::unique_ptr<NamedService<RpcService>>> services_;
130 std::vector<std::unique_ptr<NamedService<AsynchronousService>>> async_services_;
131 std::vector<Port> ports_;
132 std::vector<ServerCompletionQueue*> cqs_;
133 std::shared_ptr<ServerCredentials> creds_;
134 AsyncGenericService* generic_service_;
135 ThreadPoolInterface* thread_pool_;
140 #endif // GRPCXX_SERVER_BUILDER_H
std::string string
Definition: config.h:112
ServerBuilder()
Definition: server_builder.cc:44
void RegisterAsyncService(AsynchronousService *service)
Definition: server_builder.cc:57
Definition: service_type.h:68
void AddListeningPort(const grpc::string &addr, std::shared_ptr< ServerCredentials > creds, int *selected_port=nullptr)
Definition: server_builder.cc:82
void SetMaxMessageSize(int max_message_size)
Definition: server_builder.h:91
Definition: async_generic_service.h:59
Definition: thread_pool_interface.h:42
void SetThreadPool(ThreadPoolInterface *thread_pool)
Definition: server_builder.cc:89
Definition: service_type.h:51
std::unique_ptr< Server > BuildAndStart()
Definition: server_builder.cc:93
std::unique_ptr< ServerCompletionQueue > AddCompletionQueue()
Definition: server_builder.cc:47
void RegisterAsyncGenericService(AsyncGenericService *service)
Definition: server_builder.cc:71
Definition: server_builder.h:54
void RegisterService(SynchronousService *service)
Definition: server_builder.cc:53