usb-device.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2015 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 
6 #include "usb-types.h"
7 #include "usb-interface.h"
8 
9 #include <memory>
10 #include <vector>
11 #include <stdint.h>
12 
13 namespace librealsense
14 {
15  namespace platform
16  {
17  class usb_device
18  {
19  public:
20  virtual ~usb_device() = default;
21 
22  virtual const usb_device_info get_info() const = 0;
23  virtual const std::vector<rs_usb_interface> get_interfaces() const = 0;
24  virtual const rs_usb_interface get_interface(uint8_t interface_number) const = 0;
25  virtual const rs_usb_messenger open(uint8_t interface_number) = 0;
26  virtual const std::vector<usb_descriptor> get_descriptors() const = 0;
27  };
28 
29  typedef std::shared_ptr<usb_device> rs_usb_device;
30 
31  class usb_device_mock : public usb_device
32  {
33  public:
34  virtual ~usb_device_mock() = default;
35 
36  virtual const usb_device_info get_info() const override { return usb_device_info(); }
37  virtual const std::vector<rs_usb_interface> get_interfaces() const override { return std::vector<std::shared_ptr<usb_interface>>(); }
38  virtual const rs_usb_interface get_interface(uint8_t interface_number) const override { return nullptr; }
39  virtual const rs_usb_messenger open(uint8_t interface_number) override { return nullptr; }
40  virtual const std::vector<usb_descriptor> get_descriptors() const override { return std::vector<usb_descriptor>(); }
41  };
42  }
43 }
std::shared_ptr< usb_interface > rs_usb_interface
Definition: usb-interface.h:31
virtual const usb_device_info get_info() const override
Definition: usb-device.h:36
virtual const rs_usb_interface get_interface(uint8_t interface_number) const override
Definition: usb-device.h:38
unsigned char uint8_t
Definition: stdint.h:78
virtual const std::vector< rs_usb_interface > get_interfaces() const override
Definition: usb-device.h:37
virtual const usb_device_info get_info() const =0
std::shared_ptr< usb_messenger > rs_usb_messenger
Definition: usb-messenger.h:26
virtual const std::vector< usb_descriptor > get_descriptors() const override
Definition: usb-device.h:40
virtual const std::vector< rs_usb_interface > get_interfaces() const =0
virtual const std::vector< usb_descriptor > get_descriptors() const =0
virtual const rs_usb_interface get_interface(uint8_t interface_number) const =0
virtual const rs_usb_messenger open(uint8_t interface_number)=0
virtual const rs_usb_messenger open(uint8_t interface_number) override
Definition: usb-device.h:39
std::shared_ptr< usb_device > rs_usb_device
Definition: usb-device.h:29


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:13