Viam C++ SDK current
Loading...
Searching...
No Matches
handler_map.hpp
1#pragma once
2
3#include <viam/sdk/common/proto_convert.hpp>
4#include <viam/sdk/resource/resource.hpp>
5
6namespace viam {
7namespace module {
8namespace v1 {
9
10class HandlerMap;
11
12} // namespace v1
13} // namespace module
14} // namespace viam
15
16namespace viam {
17namespace sdk {
18
20 public:
21 HandlerMap_() = default;
22
23 void add_model(Model model, const RPCSubtype& subtype);
24
25 const std::unordered_map<RPCSubtype, std::vector<Model>>& handles() const;
26
27 private:
28 std::unordered_map<RPCSubtype, std::vector<Model>> handles_;
29};
30
31std::ostream& operator<<(std::ostream& os, const HandlerMap_& hm);
32
33namespace proto_convert_details {
34
35template <>
37 void operator()(const HandlerMap_&, module::v1::HandlerMap*) const;
38};
39
40template <>
41struct from_proto_impl<module::v1::HandlerMap> {
42 HandlerMap_ operator()(const module::v1::HandlerMap*) const;
43};
44
45} // namespace proto_convert_details
46} // namespace sdk
47} // namespace viam
Definition handler_map.hpp:19
Defines the namespace_, family, and name for a particular resource model.
Definition resource_api.hpp:125
Definition resource_api.hpp:98