xref: /haiku/src/apps/haikudepot/server/IncrementViewCounterProcess.h (revision 13581b3d2a71545960b98fefebc5225b5bf29072)
1 /*
2  * Copyright 2021-2022, Andrew Lindesay <apl@lindesay.co.nz>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 #ifndef INCREMENT_VIEW_COUNTER_PROCESS_H
6 #define INCREMENT_VIEW_COUNTER_PROCESS_H
7 
8 #include "AbstractProcess.h"
9 #include "Model.h"
10 #include "PackageInfo.h"
11 
12 
13 class Model;
14 
15 
16 class IncrementViewCounterProcess : public AbstractProcess {
17 public:
18 								IncrementViewCounterProcess(
19 									Model* model,
20 									const PackageInfoRef& package);
21 	virtual						~IncrementViewCounterProcess();
22 
23 			const char*			Name() const;
24 			const char*			Description() const;
25 
26 protected:
27 	virtual	status_t			RunInternal();
28 
29 private:
30 			void				_SpinBetweenAttempts();
31 
32 private:
33 			BString				fDescription;
34 			PackageInfoRef		fPackage;
35 			Model*				fModel;
36 };
37 
38 #endif // INCREMENT_VIEW_COUNTER_PROCESS_H
39