OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
USBSerialEnumImpl.cpp
Go to the documentation of this file.
1 
11 // Copyright 2015 Sensics, Inc.
12 //
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 //
17 // http://www.apache.org/licenses/LICENSE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the License is distributed on an "AS IS" BASIS,
21 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 // See the License for the specific language governing permissions and
23 // limitations under the License.
24 
25 // Internal Includes
27 #include "USBSerialEnumImpl.h"
28 #include "USBSerialDevInfo.h"
29 
30 // Library/third-party includes
31 
32 // Standard includes
33 #include <memory>
34 #include <iostream>
35 
36 namespace osvr {
37 namespace usbserial {
38 
39  EnumeratorImpl::EnumeratorImpl() : devices(getSerialDeviceList()) {}
40 
41  EnumeratorImpl::EnumeratorImpl(uint16_t vendorID, uint16_t productID)
42  : devices(getSerialDeviceList(vendorID, productID)) {}
43 
44  EnumeratorImpl::~EnumeratorImpl() {}
45 
46  EnumeratorIterator EnumeratorImpl::begin() {
47  return EnumeratorIterator(devices, 0);
48  }
49 
50  EnumeratorIterator EnumeratorImpl::end() {
51  return EnumeratorIterator(devices, devices.size());
52  }
53 
54 } // namespace usbserial
55 } // namespace osvr