Viam C++ SDK current
Loading...
Searching...
No Matches
generic.hpp
Go to the documentation of this file.
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
11namespace viam {
12namespace sdk {
13
21 public:
25 virtual ProtoStruct do_command(const ProtoStruct& command) = 0;
26
29 inline std::vector<GeometryConfig> get_geometries() {
30 return get_geometries({});
31 }
32
33 virtual std::vector<GeometryConfig> get_geometries(const ProtoStruct& extra) = 0;
34
36 API api() const override;
37
38 protected:
39 explicit GenericComponent(std::string name);
40};
41
42template <>
44 static API api();
45};
46
47} // namespace sdk
48} // namespace viam
Extends APIType to additionally define a resource's subtype (e.g., camera).
Definition resource_api.hpp:33
Definition component.hpp:10
A GenericComponent represents any component that can execute arbitrary commands.
Definition generic.hpp:20
API api() const override
Creates a GenericComponent API.
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling camera.
Definition generic.hpp:29
virtual ProtoStruct do_command(const ProtoStruct &command)=0
Send/receive arbitrary commands to the resource.
virtual std::string name() const
Return the resource's name.
Definition resource_api.hpp:50