All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
Pylon::IDeviceFactory Interface Referenceabstract

Interface to be implemented by device factories used to create devices. More...

#include <pylon/DeviceFactory.h>

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

Public Member Functions

virtual int EnumerateDevices (DeviceInfoList_t &list, bool addToList=false)=0
 Retrieves a list of available devices. More...
 
virtual int EnumerateDevices (DeviceInfoList_t &list, const DeviceInfoList_t &filter, bool addToList=false)=0
 Retrieves a list of available devices filtered by given properties, usable for looking for specific devices. More...
 
virtual IPylonDeviceCreateDevice (const CDeviceInfo &di)=0
 Creates a camera object from a device info object. More...
 
virtual IPylonDeviceCreateFirstDevice (const CDeviceInfo &di=CDeviceInfo())=0
 
virtual IPylonDeviceCreateDevice (const CDeviceInfo &di, const StringList_t &InjectedXmlStrings)=0
 
virtual IPylonDeviceCreateFirstDevice (const CDeviceInfo &di, const StringList_t &InjectedXmlStrings)=0
 
virtual IPylonDeviceCreateDevice (const String_t &)=0
 
virtual void DestroyDevice (IPylonDevice *)=0
 Destroys a device. More...
 
virtual bool IsDeviceAccessible (const CDeviceInfo &deviceInfo, AccessModeSet mode=Control, EDeviceAccessiblityInfo *pAccessibilityInfo=NULL)=0
 This method can be used to check if a camera device can be created and opened. More...
 

Detailed Description

Interface to be implemented by device factories used to create devices.

Each transport layer object is a device factory. These device factories must implement the IDeviceFactory interface.

Member Function Documentation

virtual IPylonDevice* Pylon::IDeviceFactory::CreateDevice ( const CDeviceInfo di)
pure 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.

Implemented in Pylon::CTlFactory.

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

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

Implemented in Pylon::CTlFactory.

virtual IPylonDevice* Pylon::IDeviceFactory::CreateDevice ( const String_t )
pure virtual

This method is deprecated. Use CreateDevice receiving a CDeviceInfo object that contains the full name as property. Example: IPylonDevice* device = TlFactory.CreateDevice( CDeviceInfo().SetFullName( fullname)); Creates a device by its unique name (i.e. fullname as returned by CDeviceInfo::GetFullName ).

Implemented in Pylon::CTlFactory.

virtual IPylonDevice* Pylon::IDeviceFactory::CreateFirstDevice ( const CDeviceInfo di = CDeviceInfo())
pure 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.

Implemented in Pylon::CTlFactory.

virtual IPylonDevice* Pylon::IDeviceFactory::CreateFirstDevice ( const CDeviceInfo di,
const StringList_t InjectedXmlStrings 
)
pure 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.

Implemented in Pylon::CTlFactory.

virtual void Pylon::IDeviceFactory::DestroyDevice ( IPylonDevice )
pure 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.

Implemented in Pylon::CTlFactory.

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

Retrieves a list of available devices.

The list contains Pylon::CDeviceInfo objects used for the device creation.

By default, the list passed in will be cleared before the device discovery is started.

Parameters
listList to be filled with device info objects.
addToListIf true, the found devices will be added to the list instead of deleting the list.
Returns
Number of devices found.

Implemented in Pylon::CTlFactory.

virtual int Pylon::IDeviceFactory::EnumerateDevices ( DeviceInfoList_t list,
const DeviceInfoList_t filter,
bool  addToList = false 
)
pure 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. By default, the list passed in 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 in the filter list. When 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, found devices will be added to the list instead of deleting the list.
Returns
Number of devices found.

Implemented in Pylon::CTlFactory.

virtual bool Pylon::IDeviceFactory::IsDeviceAccessible ( const CDeviceInfo deviceInfo,
AccessModeSet  mode = Control,
EDeviceAccessiblityInfo pAccessibilityInfo = NULL 
)
pure 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, the search is limited to the required transport layer.

Parameters
[in]deviceInfoProperties of the camera device.
[in]modeUsed for defining how a device is accessed. The use of the mode information is transport layer-specific. For IIDC 1394 devices the mode information is ignored. For GigE devices the Exclusive and Control flags are used for defining how a device is accessed.
[in]pAccessibilityInfoOptionally provides more information about why a device is not accessible.
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.

Implemented in Pylon::CTlFactory.


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

pylon 5.0.5
Copyright © 2006-2016 Basler AG (Thu Aug 11 2016 18:01:28)