mirror of
https://github.com/jezhiggins/arabica
synced 2024-12-27 21:58:30 +01:00
39 lines
675 B
C++
39 lines
675 B
C++
#ifndef JEZUK_DOM_TRAVERSAL_IMPL_H
|
|
#define JEZUK_DOM_TRAVERSAL_IMPL_H
|
|
|
|
namespace Arabica
|
|
{
|
|
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 TraversalImpl
|
|
|
|
} // namespace DOM
|
|
} // namespace Arabica
|
|
|
|
#endif //JEZUK_DOM_TRAVERSAL_IMPL_H
|