2011-01-22 01:18:58 +03:00
|
|
|
/*
|
2015-05-18 19:21:58 +03:00
|
|
|
* Copyright 2011-2015, Haiku, Inc.
|
2011-01-22 01:18:58 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2011-01-25 20:07:27 +03:00
|
|
|
#ifndef _PACKAGE__REQUEST_H_
|
|
|
|
#define _PACKAGE__REQUEST_H_
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
#include <package/Job.h>
|
2011-01-24 23:48:03 +03:00
|
|
|
|
2011-01-22 01:18:58 +03:00
|
|
|
|
2015-05-18 19:21:58 +03:00
|
|
|
namespace BSupportKit {
|
|
|
|
namespace BPrivate {
|
|
|
|
class JobQueue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
namespace BPackageKit {
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
class BContext;
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
|
2015-05-18 19:21:58 +03:00
|
|
|
class BRequest : protected BSupportKit::BJobStateListener {
|
2011-01-22 01:18:58 +03:00
|
|
|
public:
|
2011-01-25 20:07:27 +03:00
|
|
|
BRequest(const BContext& context);
|
|
|
|
virtual ~BRequest();
|
|
|
|
|
|
|
|
status_t InitCheck() const;
|
2011-01-22 01:18:58 +03:00
|
|
|
|
2011-01-24 23:48:03 +03:00
|
|
|
virtual status_t CreateInitialJobs() = 0;
|
2011-01-22 01:18:58 +03:00
|
|
|
|
2015-05-18 19:21:58 +03:00
|
|
|
BSupportKit::BJob* PopRunnableJob();
|
2011-01-22 01:18:58 +03:00
|
|
|
|
2013-04-20 15:26:34 +04:00
|
|
|
status_t Process(bool failIfCanceledOnly = false);
|
|
|
|
|
2011-01-22 01:18:58 +03:00
|
|
|
protected:
|
2015-05-18 19:21:58 +03:00
|
|
|
status_t QueueJob(BSupportKit::BJob* job);
|
2011-01-24 23:48:03 +03:00
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
const BContext& fContext;
|
2011-01-24 23:48:03 +03:00
|
|
|
|
2013-04-20 23:12:40 +04:00
|
|
|
protected:
|
2011-01-25 20:07:27 +03:00
|
|
|
status_t fInitStatus;
|
2015-05-18 19:21:58 +03:00
|
|
|
BSupportKit::BPrivate::JobQueue*
|
|
|
|
fJobQueue;
|
2011-01-22 01:18:58 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
} // namespace BPackageKit
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
#endif // _PACKAGE__REQUEST_H_
|