urbackup_backend/Interface/Object.h
2012-04-15 16:19:27 +02:00

30 lines
333 B
C++

#ifndef IOBJECT_H
#define IOBJECT_H
class IObject
{
public:
virtual ~IObject(void)
{
}
virtual void Remove(void)
{
delete this;
}
};
class ObjectScope
{
public:
ObjectScope(IObject *obj)
: obj(obj) {}
~ObjectScope(void){
obj->Remove();
}
private:
IObject *obj;
};
#endif //IOBJECT_H