WvStreams
debian/libwvstreams-dev/usr/include/wvstreams/xplc/IObject.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 *
3 * XPLC - Cross-Platform Lightweight Components
4 * Copyright (C) 2000-2003, Pierre Phaneuf
5 * Copyright (C) 2002, Net Integration Technologies, Inc.
6 * Copyright (C) 2002, Stéphane Lajoie
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * USA
22 */
23
24#ifndef __XPLC_IOBJECT_H__
25#define __XPLC_IOBJECT_H__
26
27#if defined(__GNUC__) && __GNUC__ > 3
28# pragma GCC system_header
29#endif
30
36#include <xplc/uuid.h>
37
38#ifndef UNSTABLE
46#define UNSTABLE_INTERFACE static bool UNSTABLE_INTERFACE = true;
47#else
48#define UNSTABLE_INTERFACE
49#endif
50
51class IWeakRef;
52
65class IObject {
67public:
83 virtual unsigned int addRef() = 0;
84
96 virtual unsigned int release() = 0;
97
112 virtual IObject* getInterface(const UUID&) = 0;
113
123 virtual IWeakRef* getWeakRef() = 0;
124};
125
127DEFINE_IID(IObject, {0x8ca76e98, 0xb653, 0x43d7,
128 {0xb0, 0x56, 0x8b, 0x9d, 0xde, 0x9a, 0xbe, 0x9d}});
129
130#endif /* __XPLC_IOBJECT_H__ */
The basic interface which is included by all other XPLC interfaces and objects.
virtual IWeakRef * getWeakRef()=0
Return a weak reference to this object.
virtual unsigned int addRef()=0
Indicate you are using this object.
virtual IObject * getInterface(const UUID &)=0
Returns the requested XPLC interface.
virtual unsigned int release()=0
Indicate that you are finished using this object.
Represents a weak reference to another object.
#define DEFINE_IID(iface, u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11)
Used to define the IID of an interface.
#define UNSTABLE_INTERFACE
Used to mark an interface as unstable.