Update api & link libs

This commit is contained in:
John Zhao
2018-04-26 09:22:29 +08:00
parent cd28fa58d3
commit 1fd44f7f0c
5 changed files with 52 additions and 3 deletions

View File

@@ -2,9 +2,13 @@
#include <glog/logging.h>
#include "mynteye/utils.h"
#include "device/device.h"
MYNTEYE_BEGIN_NAMESPACE
API::API() {
API::API(std::shared_ptr<Device> device) : device_(device) {
VLOG(2) << __func__;
}
@@ -12,4 +16,12 @@ API::~API() {
VLOG(2) << __func__;
}
std::shared_ptr<API> API::Create() {
return Create(device::select());
}
std::shared_ptr<API> API::Create(std::shared_ptr<Device> device) {
return std::make_shared<API>(device);
}
MYNTEYE_END_NAMESPACE

View File

@@ -2,14 +2,24 @@
#define MYNTEYE_API_H_
#pragma once
#include <memory>
#include "mynteye/mynteye.h"
MYNTEYE_BEGIN_NAMESPACE
class Device;
class MYNTEYE_API API {
public:
API();
~API();
explicit API(std::shared_ptr<Device> device);
/*virtual*/ ~API();
static std::shared_ptr<API> Create();
static std::shared_ptr<API> Create(std::shared_ptr<Device> device);
private:
std::shared_ptr<Device> device_;
};
MYNTEYE_END_NAMESPACE