mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-09 05:24:58 +01:00
40 lines
626 B
C
40 lines
626 B
C
|
#ifndef JEZUK_DOM_TRAVERSAL_IMPL_H
|
||
|
#define JEZUK_DOM_TRAVERSAL_IMPL_H
|
||
|
|
||
|
namespace DOM
|
||
|
{
|
||
|
|
||
|
//todo: move this class somewhere (or rename to TraversalImpl??)
|
||
|
class TraversalImpl
|
||
|
{
|
||
|
public:
|
||
|
TraversalImpl() : refCount_(0)
|
||
|
{}
|
||
|
|
||
|
virtual ~TraversalImpl() {}
|
||
|
|
||
|
///////////////////////////////////////////////////////
|
||
|
// Ref counting
|
||
|
virtual void addRef()
|
||
|
{
|
||
|
++refCount_;
|
||
|
} // addRef
|
||
|
|
||
|
virtual void releaseRef()
|
||
|
{
|
||
|
if(--refCount_ == 0)
|
||
|
delete this;
|
||
|
} // releaseRef
|
||
|
|
||
|
|
||
|
private:
|
||
|
int refCount_;
|
||
|
|
||
|
}; //class Impl
|
||
|
|
||
|
|
||
|
|
||
|
} // namespace DOM
|
||
|
|
||
|
#endif //JEZUK_DOM_TRAVERSAL_IMPL_H
|