2018-04-04 05:50:27 +03:00
|
|
|
#ifndef MYNTEYE_DEVICE_H_ // NOLINT
|
|
|
|
#define MYNTEYE_DEVICE_H_
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "mynteye/mynteye.h"
|
2018-04-04 10:52:10 +03:00
|
|
|
#include "mynteye/types.h"
|
2018-04-04 05:50:27 +03:00
|
|
|
|
|
|
|
MYNTEYE_BEGIN_NAMESPACE
|
|
|
|
|
|
|
|
namespace uvc {
|
|
|
|
|
|
|
|
struct device;
|
|
|
|
|
|
|
|
} // namespace uvc
|
|
|
|
|
2018-04-04 10:52:10 +03:00
|
|
|
struct DeviceInfo;
|
|
|
|
|
2018-04-04 05:50:27 +03:00
|
|
|
class Device {
|
|
|
|
public:
|
2018-04-04 10:52:10 +03:00
|
|
|
Device(const Model &model, std::shared_ptr<uvc::device> device);
|
2018-04-04 05:50:27 +03:00
|
|
|
virtual ~Device();
|
|
|
|
|
|
|
|
static std::shared_ptr<Device> Create(
|
|
|
|
const std::string &name, std::shared_ptr<uvc::device> device);
|
|
|
|
|
2018-04-04 10:52:10 +03:00
|
|
|
bool Supports(const Stream &stream) const;
|
|
|
|
bool Supports(const Capabilities &capability) const;
|
|
|
|
bool Supports(const Option &option) const;
|
|
|
|
|
|
|
|
std::shared_ptr<DeviceInfo> GetInfo() const;
|
|
|
|
std::string GetInfo(const Info &info) const;
|
|
|
|
|
|
|
|
Model model() const {
|
|
|
|
return model_;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
std::shared_ptr<uvc::device> device() const {
|
|
|
|
return device_;
|
|
|
|
}
|
|
|
|
|
2018-04-04 05:50:27 +03:00
|
|
|
private:
|
2018-04-04 10:52:10 +03:00
|
|
|
Model model_;
|
|
|
|
std::shared_ptr<uvc::device> device_;
|
|
|
|
std::shared_ptr<DeviceInfo> device_info_;
|
2018-04-04 05:50:27 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
MYNTEYE_END_NAMESPACE
|
|
|
|
|
|
|
|
#endif // MYNTEYE_DEVICE_H_ NOLINT
|