adding eoNonUniformOperator to eoOp.h
This commit is contained in:
parent
7d7542e705
commit
b5d3db43ad
1 changed files with 25 additions and 0 deletions
|
|
@ -201,4 +201,29 @@ public:
|
|||
};
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
eoNonUniformOperator: base class for non uniform operators
|
||||
*/
|
||||
|
||||
class eoNonUniformOperator
|
||||
{
|
||||
public:
|
||||
eoNonUniformOperator(const unsigned _max_time = 1):
|
||||
time_value(0), max_time_value(max(_max_time, 1u)) {}
|
||||
|
||||
void reset() { time_value = 0; }
|
||||
|
||||
unsigned time() const { return time_value; }
|
||||
|
||||
unsigned max_time() const { return max_time_value; }
|
||||
void max_time(const unsigned _max_time) { max_time_value = _max_time; }
|
||||
|
||||
void operator++() { ++time_value; }
|
||||
void operator++(int) { ++time_value; }
|
||||
|
||||
private:
|
||||
unsigned time_value, max_time_value;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue