xref: /haiku/headers/os/package/Request.h (revision 820dca4df6c7bf955c46e8f6521b9408f50b2900)
1 /*
2  * Copyright 2011, Haiku, Inc.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _PACKAGE__REQUEST_H_
6 #define _PACKAGE__REQUEST_H_
7 
8 
9 #include <SupportDefs.h>
10 
11 #include <package/Job.h>
12 
13 
14 namespace BPackageKit {
15 
16 
17 class BContext;
18 namespace BPrivate {
19 	class JobQueue;
20 }
21 using BPrivate::JobQueue;
22 
23 
24 class BRequest : protected BJobStateListener {
25 public:
26 								BRequest(const BContext& context);
27 	virtual						~BRequest();
28 
29 			status_t			InitCheck() const;
30 
31 	virtual	status_t			CreateInitialJobs() = 0;
32 
33 			BJob*				PopRunnableJob();
34 
35 protected:
36 			status_t			QueueJob(BJob* job);
37 
38 			const BContext&		fContext;
39 
40 private:
41 			status_t			fInitStatus;
42 			JobQueue*			fJobQueue;
43 };
44 
45 
46 }	// namespace BPackageKit
47 
48 
49 #endif // _PACKAGE__REQUEST_H_
50