Viam C++ SDK current
Loading...
Searching...
No Matches
generic.hpp
1
5#pragma once
6
7#include <google/protobuf/descriptor.h>
8
9#include <viam/sdk/common/proto_value.hpp>
10#include <viam/sdk/common/utils.hpp>
11#include <viam/sdk/config/resource.hpp>
12#include <viam/sdk/services/service.hpp>
13
14namespace viam {
15namespace sdk {
16
23class GenericService : public Service {
24 public:
28 virtual ProtoStruct do_command(const ProtoStruct& command) = 0;
29
31 API api() const override;
32
33 protected:
34 explicit GenericService(std::string name);
35};
36
37template <>
39 static API api();
40};
41
42} // namespace sdk
43} // 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:23
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:12
Definition resource_api.hpp:50