15 #ifndef UTILS_REFERENCE_COUTER_H_INCLUDED
16 #define UTILS_REFERENCE_COUTER_H_INCLUDED
34 static_assert(std::numeric_limits<T_integral>::is_signed,
"Reference counter must be a signed integer");
39 enum {NEW=0, NOT_COUNTED = -1};
45 operator T_integral
const ()
const {
return count_;}
47 T_integral
const set(T_integral
const a) { count_=
a;
return count_; }
48 T_integral
const inc(){
49 if (count_ >= 0) { count_ += 1; }
51 T_integral
const dec(){
52 if( count_ > 0) { count_ -= 1; }
54 T_integral
const enable_count(){
55 if (count_ < 0) {count_ = 0;}
57 T_integral
const disable_count(){
61 T_integral
const operator++(){
return inc();}
62 T_integral
const operator++(
int){T_integral ret(count_); inc();
return ret;}
63 T_integral
const operator--(){
return dec();}
64 T_integral
const operator--(
int){T_integral ret(count_); dec();
return ret;}
void set(CURSOR_TYPE type)
Use the default parameter to reset cursors.
t_ref_counter is a reference counter.
GLboolean GLboolean GLboolean GLboolean a
GLint GLint GLint GLint GLint x