GRPC C++  1.4.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
server_builder_plugin.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2016, Google Inc.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  * * Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * * Redistributions in binary form must reproduce the above
13  * copyright notice, this list of conditions and the following disclaimer
14  * in the documentation and/or other materials provided with the
15  * distribution.
16  * * Neither the name of Google Inc. nor the names of its
17  * contributors may be used to endorse or promote products derived from
18  * this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  */
33 
34 #ifndef GRPCXX_IMPL_SERVER_BUILDER_PLUGIN_H
35 #define GRPCXX_IMPL_SERVER_BUILDER_PLUGIN_H
36 
37 #include <memory>
38 
39 #include <grpc++/support/config.h>
40 
41 namespace grpc {
42 
43 class ServerBuilder;
44 class ServerInitializer;
45 class ChannelArguments;
46 
51  public:
52  virtual ~ServerBuilderPlugin() {}
53  virtual grpc::string name() = 0;
54 
57  virtual void UpdateServerBuilder(ServerBuilder* builder) {}
58 
61  virtual void InitServer(ServerInitializer* si) = 0;
62 
64  virtual void Finish(ServerInitializer* si) = 0;
65 
68  virtual void ChangeArguments(const grpc::string& name, void* value) = 0;
69 
73 
74  virtual bool has_sync_methods() const { return false; }
75  virtual bool has_async_methods() const { return false; }
76 };
77 
78 } // namespace grpc
79 
80 #endif // GRPCXX_IMPL_SERVER_BUILDER_PLUGIN_H
std::string string
Definition: config.h:50
virtual ~ServerBuilderPlugin()
Definition: server_builder_plugin.h:52
virtual bool has_async_methods() const
Definition: server_builder_plugin.h:75
Options for channel creation.
Definition: channel_arguments.h:54
Definition: server_initializer.h:47
virtual void InitServer(ServerInitializer *si)=0
InitServer will be called in ServerBuilder::BuildAndStart(), after the Server instance is created...
virtual void ChangeArguments(const grpc::string &name, void *value)=0
ChangeArguments is an interface that can be used in ServerBuilderOption::UpdatePlugins.
virtual void UpdateChannelArguments(ChannelArguments *args)
UpdateChannelArguments will be called in ServerBuilder::BuildAndStart(), before the Server instance i...
Definition: server_builder_plugin.h:72
virtual bool has_sync_methods() const
Definition: server_builder_plugin.h:74
virtual grpc::string name()=0
virtual void UpdateServerBuilder(ServerBuilder *builder)
UpdateServerBuilder will be called at the beginning of ServerBuilder::BuildAndStart().
Definition: server_builder_plugin.h:57
virtual void Finish(ServerInitializer *si)=0
Finish will be called at the end of ServerBuilder::BuildAndStart().
This interface is meant for internal usage only.
Definition: server_builder_plugin.h:50
A builder class for the creation and startup of grpc::Server instances.
Definition: server_builder.h:69