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

Proxy for the top-level INCA COM automation object. More...

#include <IncaProxy.hpp>

Inheritance diagram for IncaProxy:
Collaboration diagram for IncaProxy:

Public Member Functions

 IncaProxy (pacemaker::inca::detail::unique_com_ptr<::IDispatch > idispatch)
 Constructs the proxy by narrowing a generic IDispatch to Inca_Dispatch.
 
 IncaProxy (IncaProxy &&)=default
 Move constructor transfers ownership of the COM connection.
 
IncaProxyoperator= (IncaProxy &&)=default
 Move assignment transfers ownership of the COM connection.
 
 ~IncaProxy ()
 Destructor; calls DisconnectFromTool() if the COM pointer is valid.
 
auto GetOpenedExperiment () -> pacemaker::inca::detail::unique_com_ptr<::IDispatch >
 Returns the COM object representing the currently open experiment.
 
auto GetOpenedExperimentView () -> pacemaker::inca::detail::unique_com_ptr<::IDispatch >
 Returns the COM object representing the currently open experiment view.
 

Detailed Description

Proxy for the top-level INCA COM automation object.

IncaProxy wraps the Inca_Dispatch COM interface, which is the root entry point of the INCA autoamation API. It provides access to the currently open experiment and experiment-view objects.

On destruction, DisconnectFromTool() is called on the underlying COM object so that INCA is notified that the client has disconnected. This ensures INCA is not left in a stale connected state after the session ends.

The class is move-only; copying is deleted to prevent accidental duplication of the COM connection.

Note
A running INCA instance must be present when the object is constructed. Obtain the required IDispatch pointer via CoCreateIntance(CLSID_Inca, ...) before constructing.
See also
pacemaker::inca::Session::connect()
pacemaker::inca::detail::COMProxy

Definition at line 33 of file IncaProxy.hpp.

Constructor & Destructor Documentation

◆ IncaProxy() [1/2]

Constructs the proxy by narrowing a generic IDispatch to Inca_Dispatch.

Calls QueryInterface internally via pacemaker::inca::detail::query_interface.

Parameters
idispatchOwning pointer to a generic IDispatch obtained from CoCreateInstance. Ownership is transferred to the proxy.
Exceptions
std::invalid_argumentif idispatch is nullptr.
std::runtime_errorif QueryInterface fails to obtain Inca_Dispatch.

◆ IncaProxy() [2/2]

IncaProxy ( IncaProxy && )
default

Move constructor transfers ownership of the COM connection.

◆ ~IncaProxy()

~IncaProxy ( )

Destructor; calls DisconnectFromTool() if the COM pointer is valid.

Notifies INCA that automation client is disconnecting. This method is safe to call even if the proxy was move-constructed from, in which case the internal pointer is nullptr and no COM call is made.

Member Function Documentation

◆ operator=()

IncaProxy & operator= ( IncaProxy && )
default

Move assignment transfers ownership of the COM connection.

◆ GetOpenedExperiment()

auto GetOpenedExperiment ( ) -> pacemaker::inca::detail::unique_com_ptr<::IDispatch >
nodiscard

Returns the COM object representing the currently open experiment.

The returned pointer wraps an IDispatch that can be narrowed to IncaOnlineExperiment_Dispatch by constructing an IncaOnlineExperimentProxy.

Returns
Owning IDispatch pointer for the open experiment.
Exceptions
std::runtime_errorif the underlying COM call fails or returns a nullptr.

◆ GetOpenedExperimentView()

auto GetOpenedExperimentView ( ) -> pacemaker::inca::detail::unique_com_ptr<::IDispatch >
nodiscard

Returns the COM object representing the currently open experiment view.

The returned pointer wraps an IDispatch that can be narrowed to IncaExperimentView_Dispatch by constructing an IncaExperimentViewProxy.

Returns
Owning IDispatch pointer to the open experiment view.
Exceptions
std::runtime_errorif the underlying COM call fails or returns a nullptr.

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