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
175 if (Internal::IsAccessToken(provider))
176 throw std::logic_error(
"access tokens do not support port or board switch");
177 auto device =
Open(provider, AcquisitionStack::PreferVin);
178 ChangeBoard(device, board);
179 ChangePort(device, port);
209 if (Internal::IsAccessToken(provider))
210 throw std::logic_error(
"access tokens do not support port or board switch");
211 auto device =
Open(provider, AcquisitionStack::PreferVin);
212 ChangeBoard(device, board);
242 if (Internal::IsAccessToken(provider))
243 throw std::logic_error(
"access tokens do not support port or board switch");
244 auto device =
Open(provider, AcquisitionStack::PreferVin);
245 ChangePort(device, port);
265 return Discover(DiscoverFlags::IgnoreVins | DiscoverFlags::IgnoreGevSD);
267 return Discover(DiscoverFlags::IgnoreVins);
295 template <
class Rep,
class Period>
313 template <
class Rep,
class Period>
343 return Discover(accessToken, DiscoverFlags::FindAll);
387 template <
class Rep,
class Period>
394 static CExports::cvbguid_t AviMpgGuid()
396 static CExports::cvbguid_t guid = {0x7DBE4A03, 0xAD3D, 0x4533, 0x85, 0x1F, 0x61, 0xB4, 0xAE, 0x62, 0xC2, 0x0E};
400 static CExports::cvbguid_t EmuGuid()
402 static CExports::cvbguid_t guid = {0x10cb8e8f, 0x00b6, 0x4bb0, 0xbb, 0x82, 0xcd, 0x77, 0x2c, 0xba, 0xb7, 0x57};
406 static std::mutex &LockAnchor()
408 static std::mutex mutex;
413 DeviceFactory() noexcept = delete;
415 static
void ChangeBoard(
DevicePtr &device,
int board);
417 static
void ChangeBoard1(
DevicePtr &device,
int board);
419 static
void ChangeBoard2(
DevicePtr &device,
int board);
421 static
void ChangePort(
DevicePtr &device,
int port);
423 static
void ChangePort1(
DevicePtr &device,
int port);
425 static
void ChangePort2(
DevicePtr &device,
int port);
429 return acquisitionStack == Cvb::AcquisitionStack::PreferVin
430 || acquisitionStack == Cvb::AcquisitionStack::PreferGenTL;
437 static HandleGuard<Device> LoadAsNonStreaming(
const String &provider);
439 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:207
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:341
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:296
static std::vector< DiscoveryInformation > Discover()
Discovers available devices (not vins) with a default time span of 300ms.
Definition decl_device_factory.hpp:262
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:224
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:388
static DevicePtr OpenPort(const String &provider, int port)
Open a device with the given provider and port.
Definition decl_device_factory.hpp:240
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:280
static DevicePtr Open(const String &provider, int port, int board)
Opens a device with the given provider.
Definition decl_device_factory.hpp:173
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:371
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:149
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:356
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:191
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:327
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)