summaryrefslogtreecommitdiff
path: root/ui/getsymbolslistthread.h
blob: b806448a5ef51352c2c5709adf69af30a7b1c349 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once

#ifndef BINARYNINJAUI_BINDINGS
#include <QtCore/QThread>
#include <QtCore/QEvent>
#endif
#include "binaryninjaapi.h"
#include "uitypes.h"


#ifdef BINARYNINJAUI_BINDINGS
// QThread has issues working in the bindings on some platforms
class GetSymbolsListThread;
#else
class BINARYNINJAUIAPI GetSymbolsListThread: public QThread
{
	Q_OBJECT

	QStringList m_allSymbols;
	std::function<void()> m_completeFunc;
	std::mutex m_mutex;
	bool m_done;
	BinaryViewRef m_view;

protected:
	virtual void run() override;

public:
	GetSymbolsListThread(BinaryViewRef view, const std::function<void()>& completeFunc);
	void cancel();

	static int m_eventType;
	int GetEventType() { return GetSymbolsListThread::m_eventType; }

	const QStringList& getSymbols() const { return m_allSymbols; }
};
#endif