From b5d3db43ade0189f2ef30c80405ace9d478008d1 Mon Sep 17 00:00:00 2001 From: gustavo Date: Tue, 5 Oct 1999 11:32:17 +0000 Subject: [PATCH] adding eoNonUniformOperator to eoOp.h --- eo/src/eoOp.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/eo/src/eoOp.h b/eo/src/eoOp.h index 2b0b13e30..b13359acd 100644 --- a/eo/src/eoOp.h +++ b/eo/src/eoOp.h @@ -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