Viam C++ SDK current
Loading...
Searching...
No Matches
generic.hpp
1
5#pragma once
6
7#include <viam/sdk/common/proto_value.hpp>
8#include <viam/sdk/common/utils.hpp>
9#include <viam/sdk/config/resource.hpp>
10#include <viam/sdk/services/service.hpp>
11
12namespace viam {
13namespace sdk {
14
21class GenericService : public Service {
22 public:
26 virtual ProtoStruct do_command(const ProtoStruct& command) = 0;
27
29 API api() const override;
30
31 protected:
32 explicit GenericService(std::string name);
33};
34
35template <>
37 static API api();
38};
39
40} // namespace sdk
41} // namespace viam
Extends APIType to additionally define a resource's subtype (e.g., camera).
Definition resource_api.hpp:33
A GenericService represents any service that can execute arbitrary commands.
Definition generic.hpp:21
virtual ProtoStruct do_command(const ProtoStruct &command)=0
Send/receive arbitrary commands to the resource.
API api() const override
Creates a GenericService API.
virtual std::string name() const
Return the resource's name.
Definition service.hpp:10
Definition resource_api.hpp:50