2012-09-08 02:50:37 +00:00
|
|
|
#ifndef _FC_PRIORITY_HPP_
|
|
|
|
|
#define _FC_PRIORITY_HPP_
|
|
|
|
|
|
|
|
|
|
namespace fc {
|
|
|
|
|
/**
|
|
|
|
|
* An integer value used to sort asynchronous tasks. The higher the
|
|
|
|
|
* prioirty the sooner it will be run.
|
|
|
|
|
*/
|
|
|
|
|
class priority {
|
|
|
|
|
public:
|
|
|
|
|
explicit priority( int v = 0):value(v){}
|
|
|
|
|
priority( const priority& p ):value(p.value){}
|
|
|
|
|
bool operator < ( const priority& p )const {
|
|
|
|
|
return value < p.value;
|
|
|
|
|
}
|
2012-09-23 06:01:27 +00:00
|
|
|
static priority max() { return priority(10000); }
|
|
|
|
|
static priority min() { return priority(-10000); }
|
2014-10-16 20:26:19 +00:00
|
|
|
static priority _internal__priority_for_short_sleeps() { return priority(-100000); }
|
2012-09-08 02:50:37 +00:00
|
|
|
int value;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
#endif // _FC_PRIORITY_HPP_
|