Top-level session object that owns the connection to a running INCA instance. More...
#include <Session.hpp>
Public Member Functions | |
| Session (const Session &)=delete | |
| Copying is deleted; the COM connection must not be duplicated. | |
| Session & | operator= (const Session &)=delete |
| Copying assignment is deleted; the COM connection must not be duplicated. | |
| Session (Session &&)=delete | |
| Move construction is deleted; the session has a unique identity. | |
| Session & | operator= (Session &&)=delete |
| Move assignment is deleted; the session has a unique identity. | |
| ~Session () | |
Destructor; triggers disconnection from INCA via IncaProxy. | |
| auto | experiment () noexcept -> Experiment & |
Returns a reference to the owned Experiment. | |
Static Public Member Functions | |
| static auto | connect () -> Session |
Factory function that connects to a running INCA instance and returns an initialised Session. | |
Top-level session object that owns the connection to a running INCA instance.
Session is the single entry point for the pacemaker library. It establishes a COM connection to a locally running INCA process, validates that an experiment is open and at least one device is online, and constructs the Experiment object through which the measurement run is controlled.
The session is non-copyable and non-movable. Exactly one Session should exist per INCA automation connection. COM must be initialised on the calling thread before connect() is invoked.
On destruction, IncaProxy's destructor calls DisconnectFromTool() so INCA is cleanly notified of the disconnection.
Definition at line 44 of file Session.hpp.
| ~Session | ( | ) |
Destructor; triggers disconnection from INCA via IncaProxy.
The IncaProxy member is destroyed first (in reverse declaration order), which calls DisconnectFromTool() on the INCA COM object. The destructor is explicitly defined (rather than defaulted in the header) to ensure this sequencing is correct across translation units.
|
staticnodiscard |
Factory function that connects to a running INCA instance and returns an initialised Session.
The function performs the following steps:
CoCreateInstance(CLSID_Inca, CLSCTX_LOCAL_SERVER) to obtain the root INCA COM object.IncaProxy.Session owning an IncaProxy and the fully initialised Experiment.Session ready for use.| std::runtime_error | if CoCreateInstance fails (INCA not installed or not running). |
| std::runtime_error | if the open experiment has no devices configured or online. |
CoInitializeEx) Copying assignment is deleted; the COM connection must not be duplicated.
Move assignment is deleted; the session has a unique identity.
|
inlinenodiscardnoexcept |
Returns a reference to the owned Experiment.
The reference is valid for the lifetime of the Session. Use it to register parameters, control recordings, and update calibration values.
Experiment object. Definition at line 91 of file Session.hpp.