Viam C++ SDK current
Loading...
Searching...
No Matches
button_client.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <memory>
7
8#include <grpcpp/channel.h>
9
10#include <viam/api/component/button/v1/button.grpc.pb.h>
11
13
14namespace viam {
15namespace sdk {
16namespace impl {
17
21class ButtonClient : public Button {
22 public:
23 using interface_type = Button;
24 ButtonClient(std::string name, std::shared_ptr<grpc::Channel> channel);
25
26 void push(const ProtoStruct& extra) override;
27 ProtoStruct do_command(const ProtoStruct& command) override;
28
29 using Button::push;
30
31 private:
32 using StubType = viam::component::button::v1::ButtonService::StubInterface;
33 std::unique_ptr<StubType> stub_;
34 std::shared_ptr<grpc::Channel> channel_;
35};
36
37} // namespace impl
38} // namespace sdk
39} // namespace viam
Defines a Button component.
A Button represents a physical or virtual button.
Definition button.hpp:23
void push()
Push the button.
Definition button.hpp:26
virtual std::string name() const
Return the resource's name.
gRPC client implementation of a Button component
Definition button_client.hpp:21
ProtoStruct do_command(const ProtoStruct &command) override
Send/receive arbitrary commands to the resource.
void push(const ProtoStruct &extra) override
Push the button.