Pylon Logo Basler Logo
Public Member Functions | List of all members
Pylon::CInstantInterface< T > Class Template Reference

Provides convenient access to an interface. More...

#include <pylon/InstantInterface.h>

Inheritance diagram for Pylon::CInstantInterface< T >:
Inheritance graph
[legend]

Public Member Functions

 CInstantInterface (const Pylon::CInfoBase &info)
 Constructor. More...
 
 ~CInstantInterface ()
 Destructor. More...
 
virtual void Open ()
 Opens the attached Pylon interface. More...
 
virtual bool IsOpen () const
 Checks if the interface is open. More...
 
virtual void Close ()
 Closes an interface. More...
 
virtual const CInterfaceInfoGetInterfaceInfo () const
 Returns the interface info object storing information like the Interface ID property. More...
 
virtual GenApi::INodeMapGetNodeMap ()
 Returns the GenApi node map used for accessing parameters provided by the interface. More...
 
virtual int EnumerateDevices (DeviceInfoList_t &list, 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 &s)
 
virtual void DestroyDevice (IPylonDevice *pDevice)
 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...
 

Detailed Description

template<typename T>
class Pylon::CInstantInterface< T >

Provides convenient access to an interface.

An interface is used to represent a frame grabber board, a network card, etc.

Note
Currently, this object type is mainly used for the pylon GenTL Consumer Transport Layer, e.g., for CoaXPress. All other pylon transport layers currently return one default interface.

Constructor & Destructor Documentation

template<typename T >
Pylon::CInstantInterface< T >::CInstantInterface ( const Pylon::CInfoBase info)
inline

Constructor.

Creates a CInstantInterface object from a CDeviceInfo or CInterfaceInfo object.

The following steps are taken:

  • The DeviceClass property is used to create the transport layer.
  • If the DeviceClass property is not available, the TlType property is used to create the first matching transport layer.
  • If the DeviceClass and TlType properties are not be available, an error will be thrown.
  • If the provided argument is of CInterfaceInfo type, this is used to create the interface.
  • If the provided argument is of CDeviceInfo type, use the InterfaceID property to create the interface.
  • If the above steps fail, the first interface is created.
Error Safety:
May throw an exception if the passed argument cannot be used to create an interface object.
template<typename T >
Pylon::CInstantInterface< T >::~CInstantInterface ( )
inline

Destructor.

All created objects are destroyed correctly.

Member Function Documentation

template<typename T >
virtual void Pylon::CInstantInterface< T >::Close ( )
inlinevirtual

Closes an interface.

Postcondition
  • The interface is closed.
  • Any previously acquired objects and references have been deleted and must not be used any longer.
Error Safety:
May throw C++ exceptions.

Implements Pylon::IInterface.

template<typename T >
virtual IPylonDevice* Pylon::CInstantInterface< T >::CreateDevice ( const CDeviceInfo di)
inlinevirtual

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.
Error Safety:
May throw C++ exceptions.

Implements Pylon::IDeviceFactory.

template<typename T >
virtual IPylonDevice* Pylon::CInstantInterface< T >::CreateDevice ( const CDeviceInfo di,
const StringList_t InjectedXmlStrings 
)
inlinevirtual

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

Error Safety:
May throw C++ exceptions.

Implements Pylon::IDeviceFactory.

template<typename T >
virtual IPylonDevice* Pylon::CInstantInterface< T >::CreateDevice ( const String_t s)
inlinevirtual

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).

Error Safety:
May throw C++ exceptions.

Implements Pylon::IDeviceFactory.

template<typename T >
virtual IPylonDevice* Pylon::CInstantInterface< T >::CreateFirstDevice ( const CDeviceInfo di = CDeviceInfo())
inlinevirtual

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.

Error Safety:
May throw C++ exceptions.

Implements Pylon::IDeviceFactory.

template<typename T >
virtual IPylonDevice* Pylon::CInstantInterface< T >::CreateFirstDevice ( const CDeviceInfo di,
const StringList_t InjectedXmlStrings 
)
inlinevirtual

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

Error Safety:
May throw C++ exceptions.

Implements Pylon::IDeviceFactory.

template<typename T >
virtual void Pylon::CInstantInterface< T >::DestroyDevice ( IPylonDevice pDevice)
inlinevirtual

Destroys a device.

Note
Never try to delete a pointer to a camera device by calling free or delete. Always use the DestroyDevice method.
Error Safety:
May throw C++ exceptions.

Implements Pylon::IDeviceFactory.

template<typename T >
virtual int Pylon::CInstantInterface< T >::EnumerateDevices ( DeviceInfoList_t list,
bool  addToList = false 
)
inlinevirtual

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.
Error Safety:
May throw C++ exceptions.

Implements Pylon::IDeviceFactory.

template<typename T >
virtual int Pylon::CInstantInterface< T >::EnumerateDevices ( DeviceInfoList_t list,
const DeviceInfoList_t filter,
bool  addToList = false 
)
inlinevirtual

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.
Error Safety:
May throw C++ exceptions.

Implements Pylon::IDeviceFactory.

template<typename T >
virtual const CInterfaceInfo& Pylon::CInstantInterface< T >::GetInterfaceInfo ( ) const
inlinevirtual

Returns the interface info object storing information like the Interface ID property.

This information is available at all times regardless of whether the interface is open or closed.

Returns
A reference to the interface info object.
Error Safety:
May throw C++ exceptions.

Implements Pylon::IInterface.

template<typename T >
virtual GenApi::INodeMap* Pylon::CInstantInterface< T >::GetNodeMap ( )
inlinevirtual

Returns the GenApi node map used for accessing parameters provided by the interface.

Note
The default interface object does not provide a node map.
Interfaces will only provide a nodemap after calling Open().
Returns
Returns the GenApi node map used for accessing parameters provided by the interface. If no parameters are available, NULL is returned.
Error Safety:
May throw C++ exceptions.

Implements Pylon::IInterface.

template<typename T >
virtual bool Pylon::CInstantInterface< T >::IsDeviceAccessible ( const CDeviceInfo deviceInfo,
AccessModeSet  mode = Control,
EDeviceAccessiblityInfo pAccessibilityInfo = NULL 
)
inlinevirtual

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.
Error Safety:
May throw C++ exceptions.

Implements Pylon::IDeviceFactory.

template<typename T >
virtual bool Pylon::CInstantInterface< T >::IsOpen ( ) const
inlinevirtual

Checks if the interface is open.

Note
The 'open' status of an interface instance won't change even if an attached camera is used, e.g., opened or closed.
Returns
Returns true if the interface is open.
Error Safety:
May throw C++ exceptions.

Implements Pylon::IInterface.

template<typename T >
virtual void Pylon::CInstantInterface< T >::Open ( )
inlinevirtual

Opens the attached Pylon interface.

This call is neccessary to work with all parameters.

Postcondition
  • The interface is opened.
  • The nodemap and parameters are available and accessable.
Error Safety:
May throw C++ exceptions.

Implements Pylon::IInterface.


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)