10#include "../global.hpp"
11#include "../exception.hpp"
12#include "../string.hpp"
14#include "../utilities/system_info.hpp"
16#include "../driver/discovery_information.hpp"
38 class DeviceFactory final
176 if (Internal::IsAccessToken(provider))
177 throw std::logic_error(
"access tokens do not support port or board switch");
178 auto device =
Open(provider, AcquisitionStack::PreferVin);
179 ChangeBoard(device, board);
180 ChangePort(device, port);
210 if (Internal::IsAccessToken(provider))
211 throw std::logic_error(
"access tokens do not support port or board switch");
212 auto device =
Open(provider, AcquisitionStack::PreferVin);
213 ChangeBoard(device, board);
243 if (Internal::IsAccessToken(provider))
244 throw std::logic_error(
"access tokens do not support port or board switch");
245 auto device =
Open(provider, AcquisitionStack::PreferVin);
246 ChangePort(device, port);
266 return Discover(DiscoverFlags::IgnoreVins | DiscoverFlags::IgnoreGevSD);
268 return Discover(DiscoverFlags::IgnoreVins);
296 template <
class Rep,
class Period>
314 template <
class Rep,
class Period>
344 return Discover(accessToken, DiscoverFlags::FindAll);
388 template <
class Rep,
class Period>
395 static CExports::cvbguid_t AviMpgGuid()
397 static CExports::cvbguid_t guid = {0x7DBE4A03, 0xAD3D, 0x4533, {0x85, 0x1F, 0x61, 0xB4, 0xAE, 0x62, 0xC2, 0x0E}};
401 static CExports::cvbguid_t EmuGuid()
403 static CExports::cvbguid_t guid = {0x10cb8e8f, 0x00b6, 0x4bb0, {0xbb, 0x82, 0xcd, 0x77, 0x2c, 0xba, 0xb7, 0x57}};
407 static std::mutex &LockAnchor()
409 static std::mutex mutex;
414 DeviceFactory() noexcept = delete;
416 static
void ChangeBoard(
DevicePtr &device,
int board);
418 static
void ChangeBoard1(
DevicePtr &device,
int board);
420 static
void ChangeBoard2(
DevicePtr &device,
int board);
422 static
void ChangePort(
DevicePtr &device,
int port);
424 static
void ChangePort1(
DevicePtr &device,
int port);
426 static
void ChangePort2(
DevicePtr &device,
int port);
430 return acquisitionStack == Cvb::AcquisitionStack::PreferVin
431 || acquisitionStack == Cvb::AcquisitionStack::PreferGenTL;
438 static HandleGuard<Device> LoadAsNonStreaming(
const String &provider);
440 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:208
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:342
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:297
static std::vector< DiscoveryInformation > Discover()
Discovers available devices (not vins) with a default time span of 300ms.
Definition decl_device_factory.hpp:263
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:225
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:389
static DevicePtr OpenPort(const String &provider, int port)
Open a device with the given provider and port.
Definition decl_device_factory.hpp:241
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:281
static DevicePtr Open(const String &provider, int port, int board)
Opens a device with the given provider.
Definition decl_device_factory.hpp:174
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:372
static std::shared_ptr< T > Open(const DiscoveryInformation &info, AcquisitionStack acquisitionStack=AcquisitionStack::PreferVin)
Opens a device with the given discovery information.
Definition decl_device_factory.hpp:150
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:357
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:121
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:192
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:56
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:328
AcquisitionStack
Defines the acquisition stack when opening the device.
Definition driver.hpp:282
DiscoverFlags
Flags controlling the discovery process.
Definition driver.hpp:302
Root namespace for the Image Manager interface.
Definition version.hpp:11
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)