BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
parser
include
bearparser
WatchedLocker.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <iostream>
4
#include <QtCore>
5
6
7
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
8
class
WatchedLocker
:
public
QMutexLocker<QMutex> {
9
#else
10
class
WatchedLocker
:
public
QMutexLocker {
11
#endif
12
public
:
13
WatchedLocker
(QMutex *mutex,
bool
show =
false
,
const
char
*func =
nullptr
)
14
: QMutexLocker(mutex),
showLock
(show)
15
{
16
if
(func)
funcName
= func;
17
if
(
showLock
) {
18
std::cout << __FUNCTION__;
19
if
(
funcName
.length()) {
20
std::cout <<
" : "
<<
funcName
;
21
}
22
std::cout << std::endl;
23
}
24
}
25
26
~WatchedLocker
()
27
{
28
if
(
showLock
) {
29
std::cout << __FUNCTION__;
30
if
(
funcName
.length()) {
31
std::cout <<
" : "
<<
funcName
;
32
}
33
std::cout << std::endl;
34
}
35
}
36
37
protected
:
38
std::string
funcName
;
39
bool
showLock
;
40
};
WatchedLocker
Definition
WatchedLocker.h:8
WatchedLocker::showLock
bool showLock
Definition
WatchedLocker.h:39
WatchedLocker::funcName
std::string funcName
Definition
WatchedLocker.h:38
WatchedLocker::WatchedLocker
WatchedLocker(QMutex *mutex, bool show=false, const char *func=nullptr)
Definition
WatchedLocker.h:13
WatchedLocker::~WatchedLocker
~WatchedLocker()
Definition
WatchedLocker.h:26
Generated by
1.12.0