private:
unsigned int m_count;
protected:
+ virtual void on_first()=0;
+ virtual void on_last()=0;
+ public:
+ ref_count() : ref_count(0){}
+
+ void up()
+ {
+ if ( m_count == 0 ) {
+ on_first();
+ }
+ m_count++;
+ }
+
+ void down()
+ {
+ m_count--;
+ if ( m_count == 0 ) {
+ on_last();
+ }
+ }
+
+ unsigned int get_count(){ return m_count; }
+ };
+
+ ///////////////////////////////////////////////////////////
+
+ class ref_count2
+ {
+ private:
+ unsigned int m_count;
+ protected:
//virtual void on_first()=0;
//virtual void on_last()=0;
public: