Viam C++ SDK current
Loading...
Searching...
No Matches
generic.hpp
Go to the documentation of this file.
1
5#pragma once
6
7#include <google/protobuf/descriptor.h>
8
9#include <viam/sdk/common/proto_type.hpp>
10#include <viam/sdk/common/utils.hpp>
11#include <viam/sdk/config/resource.hpp>
12
13namespace viam {
14namespace sdk {
15
23 public:
27 virtual AttributeMap do_command(const AttributeMap& command) = 0;
28
31 inline std::vector<GeometryConfig> get_geometries() {
32 return get_geometries({});
33 }
34
35 virtual std::vector<GeometryConfig> get_geometries(const AttributeMap& extra) = 0;
36
38 API api() const override;
39
40 protected:
41 explicit GenericComponent(std::string name);
42};
43
44template <>
46 static API api();
47};
48
49} // namespace sdk
50} // namespace viam
Extends APIType to additionally define a resource's subtype (e.g., camera).
Definition resource_api.hpp:33
Definition component.hpp:14
A GenericComponent represents any component that can execute arbitrary commands.
Definition generic.hpp:22
API api() const override
Creates a GenericComponent API.
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling camera.
Definition generic.hpp:31
virtual AttributeMap do_command(const AttributeMap &command)=0
Send/receive arbitrary commands to the resource.
virtual std::string name() const
Return the resource's name.
Definition resource_api.hpp:50