libvisiontransfer  10.6.0
deviceenumeration.h
1 /*******************************************************************************
2  * Copyright (c) 2023 Allied Vision Technologies GmbH
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *******************************************************************************/
14 
15 #ifndef VISIONTRANSFER_DEVICEENUMERATION_H
16 #define VISIONTRANSFER_DEVICEENUMERATION_H
17 
18 #include <vector>
19 #include "visiontransfer/common.h"
20 #include "visiontransfer/deviceinfo.h"
21 
22 namespace visiontransfer {
23 
30 class VT_EXPORT DeviceEnumeration {
31 public:
32  typedef std::vector<DeviceInfo> DeviceList;
33 
34  DeviceEnumeration();
35  ~DeviceEnumeration();
36 
42  DeviceList discoverDevices() {
43  // This code is inlined in order to provide binary compatibility with
44  // different STL implementations
45  int numDevices = 0;
46  DeviceInfo* devices = getDevicesPointer(&numDevices);
47  std::vector<DeviceInfo> ret(devices, &devices[numDevices]);
48  return ret;
49  }
50 
51 private:
52  // We follow the pimpl idiom
53  class Pimpl;
54  Pimpl* pimpl;
55 
56  // This class cannot be copied
58  DeviceEnumeration& operator=(const DeviceEnumeration&);
59 
60  DeviceInfo* getDevicesPointer(int* numDevices);
61 };
62 
63 } // namespace
64 
65 #endif
visiontransfer::DeviceEnumeration
Allows for the discovery of devices in the network.
Definition: deviceenumeration.h:42
visiontransfer::DeviceInfo
Aggregates information about a discovered device.
Definition: deviceinfo.h:59
Allied Vision