Q_DECLARE_METATYPE(QHostAddress)
// a few typedefs
-typedef QList<MsgId> MsgIdList;
-typedef QList<BufferId> BufferIdList;
+using MsgIdList = QList<MsgId>;
+using BufferIdList = QList<BufferId>;
/**
* Catch-all stream serialization operator for enum types.
value = static_cast<T>(v);
return in;
}
+
+// Exceptions
+
+/**
+ * Thrown during initialization to enforce exiting the application before the event loop is started
+ */
+struct ExitException
+{
+ int exitCode;
+ QString errorString;
+
+ ExitException(int code = EXIT_FAILURE, QString error = {})
+ : exitCode(code), errorString(std::move(error)) {}
+};