10#include "../global.hpp"
11#include "../exception.hpp"
12#include "../string.hpp"
14#include "../utilities/system_info.hpp"
16#include "../driver/discovery_information.hpp"
30 class DeviceFactory final
122 if (Internal::IsAccessToken(provider))
123 throw std::logic_error(
"access tokens do not support port or board switch");
124 auto device =
Open(provider, AcquisitionStack::PreferVin);
125 ChangeBoard(device, board);
126 ChangePort(device, port);
156 if (Internal::IsAccessToken(provider))
157 throw std::logic_error(
"access tokens do not support port or board switch");
158 auto device =
Open(provider, AcquisitionStack::PreferVin);
159 ChangeBoard(device, board);
189 if (Internal::IsAccessToken(provider))
190 throw std::logic_error(
"access tokens do not support port or board switch");
191 auto device =
Open(provider, AcquisitionStack::PreferVin);
192 ChangePort(device, port);
212 return Discover(DiscoverFlags::IgnoreVins | DiscoverFlags::IgnoreGevSD);
214 return Discover(DiscoverFlags::IgnoreVins);
242 template <
class Rep,
class Period>
260 template <
class Rep,
class Period>
290 return Discover(accessToken, DiscoverFlags::FindAll);
334 template <
class Rep,
class Period>
341 static CExports::cvbguid_t AviMpgGuid()
343 static CExports::cvbguid_t guid = {0x7DBE4A03, 0xAD3D, 0x4533, 0x85, 0x1F, 0x61, 0xB4, 0xAE, 0x62, 0xC2, 0x0E};
347 static CExports::cvbguid_t EmuGuid()
349 static CExports::cvbguid_t guid = {0x10cb8e8f, 0x00b6, 0x4bb0, 0xbb, 0x82, 0xcd, 0x77, 0x2c, 0xba, 0xb7, 0x57};
353 static std::mutex &LockAnchor()
355 static std::mutex mutex;
360 DeviceFactory() noexcept = delete;
362 static
void ChangeBoard(
DevicePtr &device,
int board);
364 static
void ChangeBoard1(
DevicePtr &device,
int board);
366 static
void ChangeBoard2(
DevicePtr &device,
int board);
368 static
void ChangePort(
DevicePtr &device,
int port);
370 static
void ChangePort1(
DevicePtr &device,
int port);
372 static
void ChangePort2(
DevicePtr &device,
int port);
376 return acquisitionStack == Cvb::AcquisitionStack::PreferVin
377 || acquisitionStack == Cvb::AcquisitionStack::PreferGenTL;
384 static HandleGuard<Device> LoadAsNonStreaming(
const String &provider);
386 static DevicePtr CreateDeviceByDriverGUID(
const String &provider, HandleGuard<Device> &&guard)
noexcept;
static DevicePtr OpenBoard(const String &provider, int board)
Open a device with the given provider and board.
Definition decl_device_factory.hpp:154
static std::vector< DiscoveryInformation > Discover(const String &accessToken)
Discovers available nodes starting on level of the given access token with a default time span of 300...
Definition decl_device_factory.hpp:288
static std::vector< DiscoveryInformation > Discover(DiscoverFlags flags, const std::chrono::duration< Rep, Period > &timeSpan)
Discovers available devices/nodes depending on the given flags.
Definition decl_device_factory.hpp:243
static std::vector< DiscoveryInformation > Discover()
Discovers available devices (not vins) with a default time span of 300ms.
Definition decl_device_factory.hpp:209
static std::vector< DiscoveryInformation > Discover(const String &accessToken, DiscoverFlags flags, const std::chrono::duration< Rep, Period > &timeSpan)
Discovers available nodes starting on level of the given access token.
static std::shared_ptr< T > OpenPort(const String &provider, int port)
Open a device with the given provider and port.
Definition decl_device_factory.hpp:171
static std::vector< DiscoveryInformation > Discover(const DiscoveryInformation &info, DiscoverFlags flags, const std::chrono::duration< Rep, Period > &timeSpan)
Discovers available nodes starting on level of the given info.
Definition decl_device_factory.hpp:335
static DevicePtr OpenPort(const String &provider, int port)
Open a device with the given provider and port.
Definition decl_device_factory.hpp:187
static std::vector< DiscoveryInformation > Discover(DiscoverFlags flags)
Discovers available devices/nodes depending on the given flags, with a default time span of 300ms.
Definition decl_device_factory.hpp:227
static DevicePtr Open(const String &provider, int port, int board)
Opens a device with the given provider.
Definition decl_device_factory.hpp:120
static std::vector< DiscoveryInformation > Discover(const DiscoveryInformation &info, DiscoverFlags flags)
Discovers available nodes starting on level of the given info with a default time span of 300ms.
Definition decl_device_factory.hpp:318
static std::vector< DiscoveryInformation > Discover(const DiscoveryInformation &info)
Discovers available nodes starting on level of the given discovery info with a default time span of 3...
Definition decl_device_factory.hpp:303
static std::shared_ptr< T > Open(const String &provider, int port, int board)
Opens a device with the given provider.
Definition decl_device_factory.hpp:97
static std::shared_ptr< T > OpenBoard(const String &provider, int board)
Open a device with the given provider and board.
Definition decl_device_factory.hpp:138
static std::shared_ptr< T > Open(const String &provider, AcquisitionStack acquisitionStack=AcquisitionStack::PreferVin)
Opens a device with the given provider with its default board and port (if applicable).
Definition decl_device_factory.hpp:48
static std::vector< DiscoveryInformation > Discover(const String &accessToken, DiscoverFlags flags)
Discovers available nodes starting on level of the given access token with a default time span of 300...
Definition decl_device_factory.hpp:274
AcquisitionStack
Defines the acquisition stack when opening the device.
Definition driver.hpp:273
DiscoverFlags
Flags controlling the discovery process.
Definition driver.hpp:293
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
std::string String
String for wide characters or unicode characters.
Definition string.hpp:49
std::shared_ptr< Device > DevicePtr
Convenience shared pointer for Device.
Definition global.hpp:98
T dynamic_pointer_cast(T... args)