akregator/src

shared.h
1/*
2 * tools_p.h
3 *
4 * Copyright (c) 2001, 2002, 2003 Frerich Raabe <raabe@kde.org>
5 *
6 * This program is distributed in the hope that it will be useful, but WITHOUT
7 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8 * FOR A PARTICULAR PURPOSE. For licensing and distribution details, check the
9 * accompanying file 'COPYING'.
10 */
11#ifndef AKREGATOR_SHARED_H
12#define AKREGATOR_SHARED_H
13
14namespace Akregator
15{
16 struct Shared
17 {
18 Shared() : count(1) { }
19 void ref() { count++; }
20 bool deref() { return !--count; }
21 unsigned int count;
22 };
23
24}
25
26#endif // AKREGATOR_SHARED_H
27