JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
IThreadUser.h
Go to the documentation of this file.
1 //
2 // Created by Nico on 06/12/2018.
3 //
4 
5 #ifndef JODA_ITHREADUSER_H
6 #define JODA_ITHREADUSER_H
7 #include <glob.h>
8 
9 #define JODA_THREAD_SINGLE size_t(1)
10 #define JODA_THREAD_NONE size_t(0)
11 #define JODA_THREAD_MAX std::numeric_limits<std::size_t>::max()
12 
13 class IThreadUser {
14  public:
16  virtual ~IThreadUser() = default;
17 
18  virtual void forceThreads(size_t threads) = 0;
19  virtual size_t getUsedThreads() const = 0;
20 
21  virtual size_t getMaxThreads() const { return maxThreads; }
22 
23  virtual void setMaxThreads(size_t maxThreads) {
25  }
26 
27  virtual size_t recommendedThreads() const = 0;
28 
29  protected:
30  size_t maxThreads;
31 };
32 
33 #endif // JODA_ITHREADUSER_H
Definition: IThreadUser.h:13
IThreadUser(size_t maxThreads)
Definition: IThreadUser.h:15
virtual void setMaxThreads(size_t maxThreads)
Definition: IThreadUser.h:23
virtual size_t recommendedThreads() const =0
virtual void forceThreads(size_t threads)=0
virtual size_t getUsedThreads() const =0
virtual ~IThreadUser()=default
virtual size_t getMaxThreads() const
Definition: IThreadUser.h:21
size_t maxThreads
Definition: IThreadUser.h:30