1/*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef THREAD_MODEL_LOADER_H
6#define THREAD_MODEL_LOADER_H
7
8#include "AbstractModelLoader.h"
9#include "Model.h"
10
11
12class ThreadModel;
13
14
15class ThreadModelLoader : public AbstractModelLoader {
16public:
17								ThreadModelLoader(Model* model,
18									Model::Thread* thread,
19									const BMessenger& target,
20									void* targetCookie);
21
22protected:
23								~ThreadModelLoader();
24
25public:
26			ThreadModel*		DetachModel();
27
28protected:
29	virtual	status_t			PrepareForLoading();
30	virtual	status_t			Load();
31	virtual	void				FinishLoading(bool success);
32
33private:
34			// shorthands for the longish structure names
35			typedef system_profiler_thread_enqueued_in_run_queue
36				thread_enqueued_in_run_queue;
37			typedef system_profiler_thread_removed_from_run_queue
38				thread_removed_from_run_queue;
39
40private:
41			status_t			_Load();
42
43private:
44			Model*				fModel;
45			Model::Thread*		fThread;
46			ThreadModel*		fThreadModel;
47};
48
49
50#endif	// THREAD_MODEL_LOADER_H
51