Interface Class Reference

Represents a device interface. More...

Public Member Functions

Interface ()=default

Creates an invalid object.

bool  is_valid () const noexcept

Checks whether this interface is a valid object.

bool  operator== (const Interface &other) const

Checks whether two interface objects refer to the same interface.

bool  operator!= (const Interface &other) const

Checks whether two interface objects refer to different interfaces.

PropertyMap  interfacePropertyMap (Error &err=Error::Default()) const

Opens the property map for the interface.

std::string  interfaceDisplayName (Error &err=Error::Default()) const

Returns the name of the device interface.

std::string  transportLayerName (Error &err=Error::Default()) const

Returns the name of the transport layer that provides this interface object.

TransportLayerType  transportLayerType (Error &err=Error::Default()) const

Returns the type of the transport layer used by this interface.

std::string  transportLayerVersion (Error &err=Error::Default()) const

Returns the version of the transport layer that provides this interface object.

std::vector< DeviceInfo enumDevices (Error &err=Error::Default()) const

Get a list of the devices currently attached to this interface.

Detailed Description

Represents a device interface.

Interfaces represent physical connections for cameras to the computer, e.g. network adapters or USB controllers.

Instances of this class are created by calling DeviceEnum::enumInterfaces() or DeviceInfo::getInterface().

Objects returned from DeviceInfo::getInterface() are potentially invalid, for example if the interface no longer exists. Check the err output parameter or Interface::is_valid(). Default-constructed Interface objects are also invalid.

Interface objects are copyable and comparable using operator== and operator!=.

Member Function Documentation

◆ enumDevices()

std::vector< DeviceInfo > enumDevices ( Error err = Error::Default()) const
inline

Get a list of the devices currently attached to this interface.

Parameters
[out]errReference to an error handler. See Error Handling for details.
Returns
A std::vector containing ic4::DeviceInfo objects providing information about the detected video capture devices.
If an error occurs, the vector is empty.

◆ interfaceDisplayName()

std::string interfaceDisplayName ( Error err = Error::Default()) const
inline

Returns the name of the device interface.

Parameters
[out]errReference to an error handler. See Error Handling for details.
Returns
The interface's name, or an empty string if an error occurred.

◆ interfacePropertyMap()

PropertyMap interfacePropertyMap ( Error err = Error::Default()) const
inline

Opens the property map for the interface.

The property map can be used to query advanced interface information or configure the interface and its attached devices.

Parameters
[out]errReference to an error handler. See Error Handling for details.
Returns
A property map. If the function fails, the property map is invalid.
Check the err output parameter or PropertyMap::is_valid().

◆ is_valid()

bool is_valid ( ) const
inlinenoexcept

Checks whether this interface is a valid object.

If DeviceInfo::getInterface() could not create a valid interface object, and the passed err was not set to ic4::Error::Throw(), an invalid object is created. All member function calls will fail.

Returns
true, if this interface object was constructed successfully, otherwise false.
In case of an error, check the error parameter of the source function for details.
See also
Error Handling

◆ operator!=()

bool operator!= ( const Interface other) const
inline

Checks whether two interface objects refer to different interfaces.

Parameters
[in]otherA second interface object.
Returns
true if the two interface objects refer to different interfaces, otherwise false.

◆ operator==()

bool operator== ( const Interface other) const
inline

Checks whether two interface objects refer to the same interface.

Parameters
[in]otherA second interface object.
Returns
true if the two interface objects refer to the same interface, otherwise false.

◆ transportLayerName()

std::string transportLayerName ( Error err = Error::Default()) const
inline

Returns the name of the transport layer that provides this interface object.

This string can be interpreted as a name for the driver providing access to devices on the interface.

Parameters
[out]errReference to an error handler. See Error Handling for details.
Returns
The name of this interface's transport layer, or an empty string if an error occurred.

◆ transportLayerType()

TransportLayerType transportLayerType ( Error err = Error::Default()) const
inline

Returns the type of the transport layer used by this interface.

Parameters
[out]errReference to an error handler. See Error Handling for details.
Returns
The transport layer type of this interface.

◆ transportLayerVersion()

std::string transportLayerVersion ( Error err = Error::Default()) const
inline

Returns the version of the transport layer that provides this interface object.

This string can be interpreted as driver version for the driver providing access devices on the interface.

Parameters
[out]errReference to an error handler. See Error Handling for details.
Returns
The version of this interface's transport layer, or an empty string if an error occurred.