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
130 if (Internal::IsAccessToken(provider))
131 throw std::logic_error(
"access tokens do not support port or board switch");
132 auto device =
Open(provider, AcquisitionStack::PreferVin);
133 ChangeBoard(device, board);
134 ChangePort(device, port);
164 if (Internal::IsAccessToken(provider))
165 throw std::logic_error(
"access tokens do not support port or board switch");
166 auto device =
Open(provider, AcquisitionStack::PreferVin);
167 ChangeBoard(device, board);
197 if (Internal::IsAccessToken(provider))
198 throw std::logic_error(
"access tokens do not support port or board switch");
199 auto device =
Open(provider, AcquisitionStack::PreferVin);
200 ChangePort(device, port);
220 return Discover(DiscoverFlags::IgnoreVins | DiscoverFlags::IgnoreGevSD);
222 return Discover(DiscoverFlags::IgnoreVins);
250 template <
class Rep,
class Period>
268 template <
class Rep,
class Period>
298 return Discover(accessToken, DiscoverFlags::FindAll);
342 template <
class Rep,
class Period>
349 static CExports::cvbguid_t AviMpgGuid()
351 static CExports::cvbguid_t guid = {0x7DBE4A03, 0xAD3D, 0x4533, 0x85, 0x1F, 0x61, 0xB4, 0xAE, 0x62, 0xC2, 0x0E};
355 static CExports::cvbguid_t EmuGuid()
357 static CExports::cvbguid_t guid = {0x10cb8e8f, 0x00b6, 0x4bb0, 0xbb, 0x82, 0xcd, 0x77, 0x2c, 0xba, 0xb7, 0x57};
361 static std::mutex &LockAnchor()
363 static std::mutex mutex;
368 DeviceFactory() noexcept = delete;
370 static
void ChangeBoard(
DevicePtr &device,
int board);
372 static
void ChangeBoard1(
DevicePtr &device,
int board);
374 static
void ChangeBoard2(
DevicePtr &device,
int board);
376 static
void ChangePort(
DevicePtr &device,
int port);
378 static
void ChangePort1(
DevicePtr &device,
int port);
380 static
void ChangePort2(
DevicePtr &device,
int port);
384 return acquisitionStack == Cvb::AcquisitionStack::PreferVin
385 || acquisitionStack == Cvb::AcquisitionStack::PreferGenTL;
392 static HandleGuard<Device> LoadAsNonStreaming(
const String &provider);
394 static DevicePtr CreateDeviceByDriverGUID(
const String &provider, HandleGuard<Device> &&guard)
noexcept;
38 class DeviceFactory final {
…};
static DevicePtr OpenBoard(const String &provider, int board)
Open a device with the given provider and board.
Definition decl_device_factory.hpp:162
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:296
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:251
static std::vector< DiscoveryInformation > Discover()
Discovers available devices (not vins) with a default time span of 300ms.
Definition decl_device_factory.hpp:217
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:179
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:343
static DevicePtr OpenPort(const String &provider, int port)
Open a device with the given provider and port.
Definition decl_device_factory.hpp:195
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:235
static DevicePtr Open(const String &provider, int port, int board)
Opens a device with the given provider.
Definition decl_device_factory.hpp:128
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:326
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:311
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:105
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:146
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:282
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 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)