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;
107 std::shared_ptr<ServerCredentials> creds,
108 int* selected_port =
nullptr);
121 std::shared_ptr<ServerCredentials> creds;
125 typedef std::unique_ptr<grpc::string> HostString;
127 struct NamedService {
128 explicit NamedService(T* s) : service(s) {}
130 : host(new grpc::
string(h)), service(s) {}
135 int max_message_size_;
136 std::vector<std::unique_ptr<NamedService<RpcService>>> services_;
137 std::vector<std::unique_ptr<NamedService<AsynchronousService>>>
139 std::vector<Port> ports_;
140 std::vector<ServerCompletionQueue*> cqs_;
141 std::shared_ptr<ServerCredentials> creds_;
142 AsyncGenericService* generic_service_;
143 ThreadPoolInterface* thread_pool_;
148 #endif // GRPCXX_SERVER_BUILDER_H
std::string string
Definition: config.h:112
void RegisterAsyncService(AsynchronousService *service)
Register an asynchronous service.
Definition: service_type.h:68
void AddListeningPort(const grpc::string &addr, std::shared_ptr< ServerCredentials > creds, int *selected_port=nullptr)
Tries to bind server to the given addr.
void SetMaxMessageSize(int max_message_size)
Set max message size in bytes.
Definition: server_builder.h:91
Definition: async_generic_service.h:59
Definition: service_type.h:51
std::unique_ptr< Server > BuildAndStart()
Return a running server which is ready for processing calls.
std::unique_ptr< ServerCompletionQueue > AddCompletionQueue()
Add a completion queue for handling asynchronous services Caller is required to keep this completion ...
void RegisterAsyncGenericService(AsyncGenericService *service)
Register a generic service.
A builder class for the creation and startup of grpc::Server instances.
Definition: server_builder.h:55
void RegisterService(SynchronousService *service)
Register a service.