// Counter base class. Provides a reference counter.
- class counter_base
+ class CounterBase
{
public:
- counter_base()
+ CounterBase()
: count(1)
{
}
- virtual ~counter_base()
+ virtual ~CounterBase()
{
}
// Counter impl class. Provides a dynamic deleter.
template <typename U>
- class counter_impl : public counter_base
+ class CounterImpl : public CounterBase
{
public:
- counter_impl(U *p)
+ CounterImpl(U *p)
: p(p)
{
}
public:
template <typename U>
explicit RefCountPtr(U *p)
- : counter(new counter_impl<U>(p))
+ : counter(new CounterImpl<U>(p))
{
}
T *get() const
{
- return static_cast<counter_impl<T>*>(counter)->get();
+ return static_cast<CounterImpl<T>*>(counter)->get();
}
long use_count() const
if(get() != p)
{
counter->release();
- counter = new counter_impl<U>(p);
+ counter = new CounterImpl<U>(p);
}
}
}
private:
- counter_base *counter;
+ CounterBase *counter;
};
}
#endif // TAGLIB_USE_CXX11