iutil/objreg.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2001 by Jorrit Tyberghein 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_IUTIL_OBJREG_H__ 00020 #define __CS_IUTIL_OBJREG_H__ 00021 00029 #include "csutil/scf.h" 00030 #include "csutil/ref.h" 00031 00032 #define CS_QUERY_REGISTRY_TAG(Reg, Tag) \ 00033 csPtr<iBase> ((iBase*) (CS_IMPLICIT_PTR_CAST(iObjectRegistry, Reg)->Get (Tag))) 00034 #define CS_QUERY_REGISTRY(Reg,Interface) \ 00035 csPtr<Interface> ((Interface*)(CS_IMPLICIT_PTR_CAST(iObjectRegistry, Reg)->Get (#Interface, \ 00036 scfInterface<Interface>::GetID(), scfInterface<Interface>::GetVersion()))) 00037 #define CS_QUERY_REGISTRY_TAG_INTERFACE(Reg, Tag, Interface) \ 00038 csPtr<Interface> ((Interface*)(CS_IMPLICIT_PTR_CAST(iObjectRegistry, Reg)->Get (Tag, \ 00039 scfInterface<Interface>::GetID(), scfInterface<Interface>::GetVersion()))) 00040 00041 struct iObjectRegistryIterator; 00042 00043 SCF_VERSION (iObjectRegistry, 0, 0, 4); 00044 00049 struct iObjectRegistry : public iBase 00050 { 00051 // Allow implicit casts through static function. 00052 CS_IMPLEMENT_IMPLICIT_PTR_CAST (iObjectRegistry); 00053 00057 virtual void Clear () = 0; 00058 00071 virtual bool Register (iBase*, char const* tag = 0) = 0; 00072 00080 virtual void Unregister (iBase*, char const* tag = 0) = 0; 00081 00086 virtual iBase* Get (char const* tag) = 0; 00087 00095 virtual iBase* Get (char const* tag, scfInterfaceID id, int version) = 0; 00096 00103 virtual csPtr<iObjectRegistryIterator> Get ( 00104 scfInterfaceID id, int version) = 0; 00105 00112 virtual csPtr<iObjectRegistryIterator> Get () = 0; 00113 }; 00114 00115 SCF_VERSION (iObjectRegistryIterator, 0, 1, 0); 00116 00121 struct iObjectRegistryIterator : public iBase 00122 { 00127 virtual bool Reset () = 0; 00128 00132 virtual const char* GetCurrentTag () = 0; 00133 00137 virtual bool HasNext () = 0; 00138 00142 virtual iBase* Next () = 0; 00143 }; 00144 00147 #endif // __CS_IUTIL_OBJREG_H__ 00148
Generated for Crystal Space by doxygen 1.2.18