00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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 Interface##_scfGetID (), Interface##_VERSION)))
00037 #define CS_QUERY_REGISTRY_TAG_INTERFACE(Reg, Tag, Interface) \
00038 csPtr<Interface> ((Interface*)(CS_IMPLICIT_PTR_CAST(iObjectRegistry, Reg)->Get (Tag, \
00039 Interface##_scfGetID (), Interface##_VERSION)))
00040
00041 struct iObjectRegistryIterator;
00042
00043 SCF_VERSION (iObjectRegistry, 0, 0, 4);
00044
00049 struct iObjectRegistry : public iBase
00050 {
00051
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