Viam C++ SDK current
Loading...
Searching...
No Matches
resource.hpp
1#pragma once
2
3#include <string>
4#include <unordered_map>
5
6#include <viam/api/app/v1/robot.pb.h>
7#include <viam/api/robot/v1/robot.pb.h>
8
9#include <viam/sdk/common/proto_value.hpp>
10#include <viam/sdk/referenceframe/frame.hpp>
11#include <viam/sdk/resource/resource_api.hpp>
12
13namespace viam {
14namespace sdk {
15
17 public:
18 std::string type;
19 ProtoStruct attributes;
20 ProtoValue converted_attributes;
21};
22
24 public:
25 static ResourceConfig from_proto(const viam::app::v1::ComponentConfig& proto_cfg);
26 viam::app::v1::ComponentConfig to_proto() const;
27 ResourceConfig(std::string type);
28 Name resource_name();
29 const API& api() const;
30 const LinkConfig& frame() const;
31 const Model& model() const;
32 const std::string& name() const;
33 const std::string& namespace_() const;
34 const std::string& type() const;
35 const ProtoStruct& attributes() const;
36
37 private:
38 API api_;
39 LinkConfig frame_;
40 Model model_;
41 std::string name_;
42 std::string namespace__;
43 std::string type_;
44 std::vector<std::string> depends_on_;
45 std::vector<ResourceLevelServiceConfig> service_config_;
46 ProtoStruct attributes_;
47 ProtoValue converted_attributes_;
48 std::vector<std::string> implicit_depends_on_;
49 void fix_api();
50};
51
52} // namespace sdk
53} // namespace viam
Extends APIType to additionally define a resource's subtype (e.g., camera).
Definition resource_api.hpp:33
Definition frame.hpp:13
Defines the namespace_, family, and name for a particular resource model.
Definition resource_api.hpp:117
A name for specific instances of resources.
Definition resource_api.hpp:63
Type-erased value for storing google::protobuf::Value types. A ProtoValue can be nullptr,...
Definition proto_value.hpp:53
Definition resource.hpp:23
Definition resource.hpp:16