Pylon Logo Basler Logo
Public Member Functions | Static Public Member Functions | List of all members
Pylon::CTlFactory Class Reference

the Transport Layer Factory More...

#include <pylon/TlFactory.h>

Inheritance diagram for Pylon::CTlFactory:
Inheritance graph
[legend]

Public Member Functions

int EnumerateTls (TlInfoList_t &list)
 Retrieves a list of available transport layers. More...
 
ITransportLayerCreateTl (const CTlInfo &ti)
 Creates a transport layer object from a transport layer info object. More...
 
ITransportLayerCreateTl (const String_t &deviceClass)
 Creates a transport layer object from a device class string. More...
 
void ReleaseTl (const ITransportLayer *pTl)
 Releases a transport layer object created by a call to CreateTl(). More...
 
virtual int EnumerateDevices (DeviceInfoList_t &, bool addToList=false)
 Retrieves a list of available devices. More...
 
virtual int EnumerateDevices (DeviceInfoList_t &list, const DeviceInfoList_t &filter, bool addToList=false)
 Retrieves a list of available devices filtered by given properties, usable for looking for specific devices. More...
 
virtual IPylonDeviceCreateDevice (const CDeviceInfo &di)
 Creates a camera object from a device info object. More...
 
virtual IPylonDeviceCreateFirstDevice (const CDeviceInfo &di=CDeviceInfo())
 
virtual IPylonDeviceCreateDevice (const CDeviceInfo &di, const StringList_t &InjectedXmlStrings)
 
virtual IPylonDeviceCreateFirstDevice (const CDeviceInfo &di, const StringList_t &InjectedXmlStrings)
 
virtual IPylonDeviceCreateDevice (const String_t &)
 
virtual void DestroyDevice (IPylonDevice *)
 Destroys a device. More...
 
virtual bool IsDeviceAccessible (const CDeviceInfo &deviceInfo, AccessModeSet mode=Control, EDeviceAccessiblityInfo *pAccessibilityInfo=NULL)
 This method can be used to check if a camera device can be created and opened. More...
 

Static Public Member Functions

static CTlFactoryGetInstance ()
 

Detailed Description

the Transport Layer Factory

Creates, Destroys and Enumerates transport layers as well as their devices.

Member Function Documentation

virtual IPylonDevice* Pylon::CTlFactory::CreateDevice ( const CDeviceInfo di)
virtual

Creates a camera object from a device info object.

This method accepts either a device info object from a device enumeration or a user-provided device info object. User-provided device info objects can be preset with properties required for a device, e.g. the user-provided name or the serial number. The implementation tries to find a matching camera by using device enumeration. When the device class property is set, the search is limited to the required transport layer.

If the device creation fails, a GenApi::GenericException will be thrown.

Parameters
diDevice info object containing all information needed to identify exactly one device.

Implements Pylon::IDeviceFactory.

virtual IPylonDevice* Pylon::CTlFactory::CreateDevice ( const CDeviceInfo di,
const StringList_t InjectedXmlStrings 
)
virtual

Creates a camera object from a device info object, injecting additional GenICam XML definition strings. Currently only one injected xml string is supported.

Implements Pylon::IDeviceFactory.

virtual IPylonDevice* Pylon::CTlFactory::CreateDevice ( const String_t )
virtual

This method is deprecated. Use CreateDevice and pass a CDeviceInfo object containing the full name as a property. Example: IPylonDevice* device = TlFactory.CreateDevice( CDeviceInfo().SetFullName( fullname)); creates a device that matches its full name (i.e., as returned by CDeviceInfo::GetFullName).

Implements Pylon::IDeviceFactory.

virtual IPylonDevice* Pylon::CTlFactory::CreateFirstDevice ( const CDeviceInfo di = CDeviceInfo())
virtual

If multiple devices match the provided properties, the first device found is created. The order in which the devices are found can vary from call to call.

Implements Pylon::IDeviceFactory.

virtual IPylonDevice* Pylon::CTlFactory::CreateFirstDevice ( const CDeviceInfo di,
const StringList_t InjectedXmlStrings 
)
virtual

Creates the first found camera device matching the provided properties, injecting additional GenICam XML definition strings. Currently only one injected xml string is supported.

Implements Pylon::IDeviceFactory.

ITransportLayer* Pylon::CTlFactory::CreateTl ( const CTlInfo ti)

Creates a transport layer object from a transport layer info object.

This method accepts a transport layer info object which can be obtained by calling EnumerateTls. For each successfully returned transport layer object, you must call ReleaseTl to free the transport layer object.

If the creation fails, a GenApi::GenericException will be thrown.

Parameters
tiTransport layer info object specifying which transport layer to create.
Returns
Pointer to the transport layer object created. If no matching transport layer could be found, NULL will be returned.
ITransportLayer* Pylon::CTlFactory::CreateTl ( const String_t deviceClass)

Creates a transport layer object from a device class string.

This method accepts a device class string. You can see a list of available device classes in the DeviceClass.h file. For each successfully returned transport layer object, you must call ReleaseTl to free the transport layer object.

If the creation fails, a GenApi::GenericException will be thrown.

Parameters
deviceClassTransport layer info object specifying which transport layer to create.
Returns
Pointer to the transport layer object created. If no matching transport layer could be found, NULL will be returned.
virtual void Pylon::CTlFactory::DestroyDevice ( IPylonDevice )
virtual

Destroys a device.

Note
Never try to delete a pointer to a camera device by calling free or delete. Always use the DestroyDevice method.

Implements Pylon::IDeviceFactory.

virtual int Pylon::CTlFactory::EnumerateDevices ( DeviceInfoList_t list,
bool  addToList = false 
)
virtual

Retrieves a list of available devices.

The list contains Pylon::CDeviceInfo objects used for the device creation and is ordered by device class and serial number using the operator Pylon::CDeviceInfo::operator<(). By default, the list will be cleared before the device discovery is started.

Parameters
listList to be filled with device info objects.
addToListIf true, the devices found will be appended to the list instead of deleting the list. Only newly discovered devices are sorted and not the entire list.
Returns
Number of devices found.

Implements Pylon::IDeviceFactory.

virtual int Pylon::CTlFactory::EnumerateDevices ( DeviceInfoList_t list,
const DeviceInfoList_t filter,
bool  addToList = false 
)
virtual

Retrieves a list of available devices filtered by given properties, usable for looking for specific devices.

The list contains Pylon::CDeviceInfo objects used for the device creation and is ordered by device class and serial number using the operator Pylon::CDeviceInfo::operator<(). By default, the list will be cleared before the device discovery is started. The filter list can contain a list of device info objects containing properties a device must have, e.g., the user-provided name or the serial number. A device is returned if it matches the properties of any of the device info objects on the filter list. If the device class property is set in the filter device info objects, the search is limited to the required transport layers.

Parameters
listList to be filled with device info objects.
filterA list of device info objects with user-provided properties that a device can match.
addToListIf true, the devices found will be appended to the list instead of deleting the list. Only newly discovered devices are sorted and not the entire list.
Returns
Number of devices found.

Implements Pylon::IDeviceFactory.

int Pylon::CTlFactory::EnumerateTls ( TlInfoList_t list)

Retrieves a list of available transport layers.

The list contains Pylon::CTlInfo objects used for transport layer creation.

Parameters
listList to be filled with transport layer info objects.
Returns
Number of transport layers found.
static CTlFactory& Pylon::CTlFactory::GetInstance ( )
static

Retrieve the transport layer factory singleton. Throws an exception when Pylon::PylonInitialize() has not been called before.

virtual bool Pylon::CTlFactory::IsDeviceAccessible ( const CDeviceInfo deviceInfo,
AccessModeSet  mode = Control,
EDeviceAccessiblityInfo pAccessibilityInfo = NULL 
)
virtual

This method can be used to check if a camera device can be created and opened.

This method accepts either a device info object from a device enumeration or a user-provided device info object. User-provided device info objects can be preset with properties required for a device, e.g. the user-provided name or the serial number. The implementation tries to find a matching camera by using device enumeration. When the device class property is set, see DeviceClass.h header file, the search is limited to the required transport layer. For more information, see Applying a Filter when Enumerating Cameras.

Parameters
[in]deviceInfoProperties to find/identify the camera device to check.
[in]modeUsed for defining how a device is accessed. The use of the mode information is transport layer-specific.
  • For BCON, CameraLink, and USB devices, the mode information is ignored.
  • For GigE devices, the Exclusive and Control flags are used for defining how a device is accessed. Other mode information is ignored.
  • For devices of any type that are accessed via the GenICam GenTL transport layer, the mode is ignored.
[out]pAccessibilityInfoOptional parameter that provides more information about whether a device is accessible or not.
Returns
True if device can be opened with provided access mode.
Precondition
The deviceInfo object properties specify exactly one device. This is the case when the device info object has been obtained using device enumeration.
Error Safety:
Throws a C++ exception, if the preconditions are not met.

Implements Pylon::IDeviceFactory.

void Pylon::CTlFactory::ReleaseTl ( const ITransportLayer pTl)

Releases a transport layer object created by a call to CreateTl().

For each successfully returned transport layer object from any CreateTl() function, you must call this function to free the transport layer object.

Parameters
pTlPointer to the transport layer object to be released.

The documentation for this class was generated from the following file:

pylon 6.1.0
Copyright (c) 2006-2020 Basler AG (Mon Mar 16 2020 10:57:00)