duvc-ctl 2.0.0
USB Video Class Camera Control Library
Loading...
Searching...
No Matches
duvc::Device Struct Reference

Represents a camera device. More...

#include <duvc-ctl/core/types.h>

Collaboration diagram for duvc::Device:

Public Member Functions

 Device ()=default
 Default constructor.
 
 Device (std::wstring n, std::wstring p)
 Construct device with name and path.
 
 Device (const Device &other)
 Copy constructor - ensures deep copy of string data.
 
Deviceoperator= (const Device &other)
 Copy assignment operator.
 
 Device (Device &&) noexcept=default
 Move constructor - transfers ownership of string data.
 
Deviceoperator= (Device &&) noexcept=default
 Move assignment operator.
 
bool is_valid () const
 Check if device has valid identifying information.
 
const std::wstring & get_id () const
 Get stable identifier for this device.
 

Public Attributes

std::wstring name
 Human-readable device name.
 
std::wstring path
 Unique device path/identifier.
 

Detailed Description

Represents a camera device.

Definition at line 131 of file types.h.

Constructor & Destructor Documentation

◆ Device() [1/4]

duvc::Device::Device ( )
default

Default constructor.

◆ Device() [2/4]

duvc::Device::Device ( std::wstring n,
std::wstring p )
inline

Construct device with name and path.

Parameters
nDevice name
pDevice path

Definition at line 143 of file types.h.

◆ Device() [3/4]

duvc::Device::Device ( const Device & other)
inline

Copy constructor - ensures deep copy of string data.

Parameters
otherDevice to copy from

Explicitly defined to ensure proper deep copying when pybind11 passes Device objects between Python and C++.

Definition at line 153 of file types.h.

◆ Device() [4/4]

duvc::Device::Device ( Device && )
defaultnoexcept

Move constructor - transfers ownership of string data.

Parameters
otherDevice to move from

Member Function Documentation

◆ get_id()

const std::wstring & duvc::Device::get_id ( ) const
inline

Get stable identifier for this device.

Returns
Path if available, otherwise name

Definition at line 192 of file types.h.

References name, and path.

◆ is_valid()

bool duvc::Device::is_valid ( ) const
inline

Check if device has valid identifying information.

Returns
true if either name or path is non-empty

Definition at line 186 of file types.h.

References name, and path.

Referenced by duvc::Camera::Camera(), duvc_device_is_valid(), duvc::get_device_capabilities(), duvc::KsPropertySet::KsPropertySet(), duvc::open_camera(), and duvc::open_camera().

Here is the caller graph for this function:

◆ operator=() [1/2]

Device & duvc::Device::operator= ( const Device & other)
inline

Copy assignment operator.

Parameters
otherDevice to copy from
Returns
Reference to this device

Definition at line 161 of file types.h.

References name, and path.

◆ operator=() [2/2]

Device & duvc::Device::operator= ( Device && )
defaultnoexcept

Move assignment operator.

Parameters
otherDevice to move from
Returns
Reference to this device

Member Data Documentation

◆ name

std::wstring duvc::Device::name

Human-readable device name.

Definition at line 132 of file types.h.

Referenced by duvc_get_device_id(), duvc_get_device_name(), duvc::get_device_capabilities(), get_id(), is_valid(), and operator=().

◆ path

std::wstring duvc::Device::path

Unique device path/identifier.

Definition at line 133 of file types.h.

Referenced by duvc_get_device_id(), duvc_get_device_path(), duvc::get_device_capabilities(), get_id(), is_valid(), and operator=().


The documentation for this struct was generated from the following files: