Other: C++ Code reformat.

This commit is contained in:
Xavier Michelon
2023-01-05 08:37:38 +01:00
parent bb07138fb0
commit 8790d3cfcf
58 changed files with 1348 additions and 1692 deletions

View File

@ -30,8 +30,7 @@ using namespace bridgepp;
/// \param[in] parent The parent object.
//****************************************************************************************************************************************************
EventStreamReader::EventStreamReader(QObject *parent)
: Worker(parent)
{
: Worker(parent) {
connect(this, &EventStreamReader::started, this, &EventStreamReader::onStarted);
connect(this, &EventStreamReader::finished, this, &EventStreamReader::onFinished);
connect(this, &EventStreamReader::error, &app().log(), &Log::error);
@ -41,20 +40,18 @@ EventStreamReader::EventStreamReader(QObject *parent)
//****************************************************************************************************************************************************
//
//****************************************************************************************************************************************************
void EventStreamReader::run()
{
try
{
void EventStreamReader::run() {
try {
emit started();
grpc::Status const status = app().grpc().runEventStreamReader();
if (!status.ok())
if (!status.ok()) {
throw Exception(QString::fromStdString(status.error_message()));
}
emit finished();
}
catch (Exception const &e)
{
catch (Exception const &e) {
reportSentryException(SENTRY_LEVEL_ERROR, "Error during event stream read", "Exception", e.what());
emit error(e.qwhat());
}
@ -64,8 +61,7 @@ void EventStreamReader::run()
//****************************************************************************************************************************************************
//
//****************************************************************************************************************************************************
void EventStreamReader::onStarted() const
{
void EventStreamReader::onStarted() const {
app().log().debug("EventStreamReader started");
}
@ -73,11 +69,9 @@ void EventStreamReader::onStarted() const
//****************************************************************************************************************************************************
//
//****************************************************************************************************************************************************
void EventStreamReader::onFinished() const
{
void EventStreamReader::onFinished() const {
app().log().debug("EventStreamReader finished");
if (!app().bridgeMonitor())
{
if (!app().bridgeMonitor()) {
// no bridge monitor means we are in a debug environment, running in attached mode. Event stream has terminated, so bridge is shutting
// down. Because we're in attached mode, bridge-gui will not get notified that bridge is going down, so we shutdown manually here.
qApp->exit(EXIT_SUCCESS);