Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

hyp.std.unknwn.h

00001 /*
00002 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
00003  Hyperion Pattern.
00004  Hyperion Pattern is a part of the Hyperion Project.
00005 ----------------------------------------------------------
00006  Copyright (c) 2001 Pierre Rebours.
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
00010  License as published by the Free Software Foundation; either
00011  version 2.1 of the License, or (at your option) any later version.
00012 
00013  This library is distributed in the hope that it will be useful,
00014  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  
00017  See hyp.license.txt file for more information about the license.
00018  
00019  Web: http://lagrandeporte.multimania.com/hyperion
00020  Email: amtycho@yahoo.fr
00021 ----------------------------------------------------------
00022  CVS
00023  $Log$
00024 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
00025 */
00026 
00027 
00028 #ifndef _hypstd_unknwn_h_
00029 #define _hypstd_unknwn_h_
00030 
00031 
00032 class CUnknown :
00033 public INondelegatingUnknown
00034 {
00035 public:
00036         CUnknown(IUnknown*);
00037         virtual ~CUnknown();
00038 
00040 
00041         virtual com_result NondelegatingQueryInterface(const hypIID&, void**);
00042         virtual t_ulong NondelegatingAddRef();
00043         virtual t_ulong NondelegatingRelease();
00045 
00049         virtual com_result Init() {
00050                 return com_ok;
00051         }
00052         virtual void FinalRelease();
00053         
00057         inline static long ActiveComponents() { 
00058                 return ms_cActiveComponents;
00059         }
00060         
00061         com_result FinishQI(IUnknown*, void**);
00062         
00063 protected:
00067         inline IUnknown* GetOuterUnknown() const {
00068                 return m_pUnknownOuter;
00069         }
00070         
00071         long m_cRef;    
00072         IUnknown* m_pUnknownOuter;      
00073         static long ms_cActiveComponents;
00074 };
00075 
00076 
00081 #define hyp_DECLARE_IUNKNOWN                                                               \
00082         virtual hyp::ker::com_result QueryInterface(const hyp::ker::hypIID & iid, void** ppv) {\
00083                 return GetOuterUnknown()->QueryInterface(iid,ppv);                                 \
00084         }                                                                                      \
00085         virtual hyp::t_ulong AddRef() {                                                        \
00086                 return GetOuterUnknown()->AddRef();                                                \
00087         }                                                                                      \
00088         virtual hyp::t_ulong Release() {                                                       \
00089                 return GetOuterUnknown()->Release();                                               \
00090         }
00091 
00092 
00093 #endif

Top of Page
written by Pierre Rebours © 2000-2001. Terms of Use.