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 virtual ProtoStruct get_status() = 0;
30
33 inline std::vector<GeometryConfig> get_geometries() {
34 return get_geometries({});
35 }
36
37 virtual std::vector<GeometryConfig> get_geometries(const ProtoStruct& extra) = 0;
38
40 API api() const override;
41
42 protected:
43 explicit GenericComponent(std::string name);
44};
45
46template <>
48 static API api();
49};
50
51} // namespace sdk
52} // namespace viam
Definition resource_api.hpp:21
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.
virtual ProtoStruct get_status()=0
Get the status of the generic component.
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling camera.
Definition generic.hpp:33
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:46