6#include <viam/sdk/common/grpc_fwd.hpp>
7#include <viam/sdk/resource/resource.hpp>
8#include <viam/sdk/resource/resource_api.hpp>
9#include <viam/sdk/resource/resource_server_base.hpp>
58 std::shared_ptr<GrpcServerCredentials> creds =
nullptr);
67 friend class ::viam::sdktests::TestServer;
70 std::unordered_map<API, std::shared_ptr<ResourceServer>> managed_servers_;
71 std::unique_ptr<GrpcServerBuilder> builder_;
72 std::unique_ptr<GrpcServer> server_;
Definition resource_api.hpp:21
Defines gRPC Server functionality.
Definition server.hpp:28
void register_service(::grpc::Service *service)
Registers a gRPC service.
void add_listening_port(const std::string &address, std::shared_ptr< GrpcServerCredentials > creds=nullptr)
Adds a listening port to the server.
std::shared_ptr< ResourceServer > lookup_resource_server(const API &api)
Returns reference to managed resource server.
void start()
Starts the grpc server. Can only be called once.
void wait()
waits on server close, only returning when the server is closed.
void add_resource(std::shared_ptr< Resource > resource)
Adds a specific managed resource to the associated resource server.
void shutdown()
Shutdown the gRPC server.