LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
context.cpp
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#include "context.h"
10
11namespace LC::Util
12{
13 namespace
14 {
15 auto MakeDeadObjectMessage (const detail::DeadObjectInfo& info)
16 {
17 const std::string prefix = "coroutine's context object " + info.ClassName_;
18 if (info.ObjectName_.isEmpty ())
19 return prefix + " died";
20 else
21 return prefix + " (" + info.ObjectName_.toStdString () + ") died";
22 }
23 }
24
26 : std::runtime_error { MakeDeadObjectMessage (info) }
27 {
28 }
29
30 namespace detail
31 {
32 void CheckDeadObjects (const QVector<DeadObjectInfo>& deadObjects)
33 {
34 if (!deadObjects.isEmpty ())
35 throw ContextDeadException { deadObjects.front () };
36 }
37 }
38}
ContextDeadException(const detail::DeadObjectInfo &info)
Definition context.cpp:25
void CheckDeadObjects(const QVector< DeadObjectInfo > &deadObjects)
Definition context.cpp:32
STL namespace.