feat: Improve ChangeState API

* Add `[[nodiscard]]` to `bool Device::ChangeState()`
* Introduce throwing variant `void Device::ChangeStateOrThrow()`

resolves #441
This commit is contained in:
Dennis Klein
2023-02-28 12:12:54 +01:00
committed by Dennis Klein
parent 5ef17fddbb
commit 435d07eaf9
4 changed files with 75 additions and 24 deletions

View File

@@ -152,7 +152,7 @@ auto DeviceRunner::Run() -> int
fDevice->RegisterChannelEndpoints();
if (fConfig.Count("print-channels")) {
fDevice->PrintRegisteredChannels();
fDevice->ChangeState(fair::mq::Transition::End);
fDevice->ChangeStateOrThrow(fair::mq::Transition::End);
return 0;
}
@@ -160,7 +160,7 @@ auto DeviceRunner::Run() -> int
if (fConfig.Count("version")) {
LOGV(info, verylow) << "FairMQ version: " << FAIRMQ_GIT_VERSION;
LOGV(info, verylow) << "User device version: " << fDevice->GetVersion();
fDevice->ChangeState(fair::mq::Transition::End);
fDevice->ChangeStateOrThrow(fair::mq::Transition::End);
return 0;
}