File indexing completed on 2024-04-28 05:11:03

0001 /*
0002  * shared.h
0003  *
0004  * SPDX-FileCopyrightText: 2001, 2002, 2003 Frerich Raabe <raabe@kde.org>
0005  *
0006  * SPDX-License-Identifier: GPL-2.0-or-later
0007  */
0008 
0009 #pragma once
0010 
0011 namespace Akregator
0012 {
0013 struct Shared {
0014     Shared()
0015         : count(1)
0016     {
0017     }
0018 
0019     void ref()
0020     {
0021         count++;
0022     }
0023 
0024     bool deref()
0025     {
0026         return !--count;
0027     }
0028 
0029     unsigned int count;
0030 };
0031 }