pacemaker 1.0.1
COM automation for people with deadlines and a hatred of GUIs
 
Loading...
Searching...
No Matches
ExperimentDeviceProxy Class Reference

Proxy for an INCA experiment device COM object. More...

#include <ExperimentDeviceProxy.hpp>

Inheritance diagram for ExperimentDeviceProxy:
Collaboration diagram for ExperimentDeviceProxy:

Public Member Functions

 ExperimentDeviceProxy (pacemaker::inca::detail::unique_com_ptr<::IDispatch > idispatch)
 Constrcuts the proxy by narrowing a generic IDispatch to ExperimentDevice_Dispatch
 
 ExperimentDeviceProxy (ExperimentDeviceProxy &&)=default
 Move contructor transfers ownership of the COM object.
 
ExperimentDeviceProxyoperator= (ExperimentDeviceProxy &&)=default
 Move assignment transfers ownership of the COM object.
 
 ~ExperimentDeviceProxy ()
 Destructor; releases the underlying COM object.
 
auto get () const noexcept -> ::ExperimentDevice_Dispatch *
 Returns a non-owning raw pointer to the underlying COM device object.
 
auto GetName () -> std::wstring
 Returns the name of the device as configured in INCA.
 

Detailed Description

Proxy for an INCA experiment device COM object.

ExperimentDeviceProxy wraps the ExperimentDevice_Dispatch COM interface, which represents a single ECU device configured in the open INCA experiment. It allows the caller to identify the device by name and to obtain a non-owning raw pointer that other INCA COM methods accept as a device argument.

Instances are normally obtained by iterating the vector returned by IncaOnlineExperimentProxy::GetAllDevices() and constructing a proxy from each element.

The class is move-only.

See also
pacemaker::inca::com::IncaOnlineExperimentProxy::GetAllDevices()
pacemaker::inca::com::IncaOnlineExperimentProxy::GetCalibrationValueInDevice()
pacemaker::inca::detail::COMProxy

Definition at line 33 of file ExperimentDeviceProxy.hpp.

Constructor & Destructor Documentation

◆ ExperimentDeviceProxy() [1/2]

Constrcuts the proxy by narrowing a generic IDispatch to ExperimentDevice_Dispatch

Parameters
idispatchOwning pointer to a generic IDispatch representing the device object. Ownership is transferred to the proxy.
Exceptions
std::invalid_argumentif idispatch is null
std::runtime_errorif QueryInterface fails to obtain ExperimentDevice_Dispatch.

◆ ExperimentDeviceProxy() [2/2]

Move contructor transfers ownership of the COM object.

◆ ~ExperimentDeviceProxy()

Destructor; releases the underlying COM object.

Member Function Documentation

◆ operator=()

ExperimentDeviceProxy & operator= ( ExperimentDeviceProxy && )
default

Move assignment transfers ownership of the COM object.

◆ get()

auto get ( ) const -> ::ExperimentDevice_Dispatch *
inlinenoexcept

Returns a non-owning raw pointer to the underlying COM device object.

The returned pointer is valid for as long as the proxy is alive. It is intended to be passed directly to COM methods that accept an ExperimentDevice_Dispatch* argument, such as IncaOnlineExperimentProxy::GetCalibrationValueInDevice().

Returns
Non-owning pointer to the ExperimentDevice_Dispatch object. Never null after successful construction.

Definition at line 64 of file ExperimentDeviceProxy.hpp.

References COMProxy<::ExperimentDevice_Dispatch >::p_subject.

◆ GetName()

auto GetName ( ) -> std::wstring
nodiscard

Returns the name of the device as configured in INCA.

Retrieves the device name via ExperimentDevice_Dispatch::GetName(), which returns a BSTR. The result is converted to a std::wstring before being returned to the caller.

Returns
Wide string containing the device name (e.g. L"XCP:1")

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