WvStreams
IObject.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002  *
00003  * XPLC - Cross-Platform Lightweight Components
00004  * Copyright (C) 2000-2003, Pierre Phaneuf
00005  * Copyright (C) 2002, Net Integration Technologies, Inc.
00006  * Copyright (C) 2002, Stéphane Lajoie
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation; either version 2.1 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021  * USA
00022  */
00023 
00024 #ifndef __XPLC_IOBJECT_H__
00025 #define __XPLC_IOBJECT_H__
00026 
00027 #if defined(__GNUC__) && __GNUC__ > 3
00028 # pragma GCC system_header
00029 #endif
00030 
00036 #include <xplc/uuid.h>
00037 
00038 #ifndef UNSTABLE
00039 
00046 #define UNSTABLE_INTERFACE static bool UNSTABLE_INTERFACE = true;
00047 #else
00048 #define UNSTABLE_INTERFACE
00049 #endif
00050 
00051 class IWeakRef;
00052 
00065 class IObject {
00066   UNSTABLE_INTERFACE
00067 public:
00083   virtual unsigned int addRef() = 0;
00084     
00096   virtual unsigned int release() = 0;
00097     
00112   virtual IObject* getInterface(const UUID&) = 0;
00113     
00123   virtual IWeakRef* getWeakRef() = 0;
00124 };
00125 
00127 DEFINE_IID(IObject, {0x8ca76e98, 0xb653, 0x43d7,
00128   {0xb0, 0x56, 0x8b, 0x9d, 0xde, 0x9a, 0xbe, 0x9d}});
00129 
00130 #endif /* __XPLC_IOBJECT_H__ */