OptrisOptrisDocumentation

Documentation/OTC SDK/OTC SDK — legacy C++ API referencev12.0

These are the pre-v12 classes, kept so existing code keeps building. New code should use the modern API — see Migration Guide: v11 to v12.

optris::DeviceClaimedHereException

This process already has this camera open, and is not letting go.

A narrower DeviceBusyException, and narrower in exactly one way that matters: retrying it is pointless. The ordinary busy refusal is a camera somebody else holds, and the holder may put it down at any moment, so Imager::Connect() spending ten attempts on it is right. This one is a live camera object inside this very process -- the application's own second open of a camera it already has -- and no number of attempts can change that answer. Ten of them is 4.5 s of sleeping to arrive at the answer the first attempt had.

It is thrown only after the wait for a transient holder has been given its chance. An open that meets this process's own claim while a release or another open is still in flight waits for it instead (kOwnClaimTransientWait) -- and that is why the rest of this could not land on its own: without the wait, a reload that disposes and reopens without awaiting the dispose would start failing where the retries currently carry it.

Deliberately not a new type on the public API. It derives from DeviceBusyException, so it reaches the v12 API as optris::sdk::DeviceBusyException, the C ABI as OPTRIS_SDK_ERROR_BUSY and C# as DeviceBusyException exactly as the refusal already does -- nothing an application catches changes, including Optris Connect.

Corrected: Corrected -- this comment used to end here, wrongly It said: "The distinction is about whether to retry, which is the SDK's decision and not the caller's, so it stays inside. The message says which of the two it is."

The first sentence is not the whole of what the distinction is about, and the second is the defect that was reported. Retrying is indeed the SDK's decision and it is still taken here. But a client needs this apart for a reason nothing inside the SDK can take for it: what to show a person. "In use by another application" is right for a foreign claim and wrong for this application's own double open, and only the application knows which of its windows is which. That is not a retry decision.

So the type still stays internal -- it is the retry rule -- and the distinction now leaves the SDK as data instead of English: DeviceBusyException::detail() carries a optris::sdk::DeviceBusyReason, which separates kAlreadyOpenInThisProcess from kHandoverInThisProcess and both from kClaimedByAnotherProcess. The message still says which it was, for a person. Neither substitutes for the other.

Inherits from optris::DeviceBusyException.

Public functions

DeviceBusyException

DeviceBusyException(std::string message, ::optris::sdk::DeviceBusyDetail detail) noexcept

Construct carrying what refused.

Parameters

Name Description
message error message.
detail which condition refused, and what it knew.