00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Benjamin Hadorn (bhadorn@swissinfo.org) * 00003 *************************************************************************** 00004 * Projekt : Zeus 00005 * Module : ZObject 00006 * Package : System 00007 * Author : Benjamin Hadorn 00008 * Datum : $Date: 10.09.09 17:02 $ 00009 * Ablage : $File$ 00010 * System : Cell Computing Model 00011 *************************************************************************** 00012 * Licence: * 00013 * This library is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU Lesser General Public License as * 00015 * published by the Free Software Foundation; either version * 00016 * 2.1 of the License, or (at your option) any later version. * 00017 * * 00018 * This library is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00021 * GNU Lesser General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU Lesser General Public * 00024 * License along with this library; if not, write to the Free Software * 00025 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00026 ***************************************************************************/ 00027 00028 /*************************************************************************** 00029 Changes : 00030 $Log: /Development_F/StuderWIN/dev/Zeus/src/zeusbase/System/ZObject.h $ 00031 ** 00032 ** 19 10.09.09 17:02 Bha 00033 ** minor changes of version 1.0.1 00034 ** 00035 ** 18 27.03.09 15:11 Bha 00036 ** new version 1.0 implemented 00037 ** 00038 ** 17 23.04.08 16:24 Bha 00039 ** windows includes depending on the usage flag 00040 ** 00041 ** 16 21.04.08 16:55 Bha 00042 ** usage of windows.h 00043 ** 00044 ** 15 7.04.08 19:08 Bha 00045 ** Usage of GUID for Interfaces 00046 ** 00047 ** 14 4.02.08 7:33 Bha 00048 ** - changed to inline methods 00049 ** - C++ casting 00050 ** 00051 ** 13 3.09.07 17:21 Mabbuehl 00052 ** VS6 warnings removed. 00053 ** 00054 ** 12 3.09.07 7:04 bha 00055 ** New Framework using auto pointer and improved lists 00056 ** 00057 ** 11 26.02.07 9:00 bha 00058 ***************************************************************************/ 00059 00060 #ifndef ZObjectH 00061 #define ZObjectH 00062 00063 #include <zeusbase/System/Interfaces/IZUnknown.hpp> 00064 #include <zeusbase/System/AutoPtr.hpp> 00065 #include <zeusbase/System/String.h> 00066 #include <zeusbase/System/GUIDWrapper.h> 00067 00068 00069 #if defined(ENABLE_LINUX_BINDING) 00070 00071 #else 00072 00073 #ifdef USE_WINDOWS_H 00074 #include <windows.h> 00075 #endif 00076 00077 #endif 00078 00079 00080 BEGIN_NAMESPACE_Zeus 00081 00082 /***************************************************************************/ 00085 /***************************************************************************/ 00086 zeusbase_class TZObject : protected IZUnknown 00087 { 00088 public: 00089 TZObject(); 00090 TZObject(TString strName); 00091 00092 Uint getHash() const; 00093 TString toString() const; 00094 00095 virtual TString getObjName() const; 00096 virtual void setObjName(const TString& name); 00097 00098 //Methoden des IZUnknown 00099 MEMORY_MANAGER_DECL 00100 00101 protected: 00102 //these method are protected and must be redeclared public 00103 // for stack objects 00104 virtual ~TZObject(); 00105 00106 TZObject(const TZObject& rObject); 00107 TZObject& operator=(const TZObject& rObject); 00108 00109 Int getRefCounter() const; 00110 Uint m_uiID; 00111 00112 private: 00114 Int m_iRefCounter; 00116 TString m_strName; 00117 }; 00118 00119 //Inline methods 00120 /***************************************************************************/ 00123 /***************************************************************************/ 00124 inline TZObject::~TZObject() 00125 {} 00126 00127 /***************************************************************************/ 00130 /***************************************************************************/ 00131 inline Uint TZObject::getHash() const 00132 { 00133 return reinterpret_cast<Uint>(this); 00134 } 00135 00136 /***************************************************************************/ 00139 /***************************************************************************/ 00140 inline TString TZObject::getObjName() const 00141 { 00142 return m_strName; 00143 } 00144 00145 /***************************************************************************/ 00148 /***************************************************************************/ 00149 inline void TZObject::setObjName(const TString& name) 00150 { 00151 m_strName = name; 00152 } 00153 00154 /***************************************************************************/ 00157 /***************************************************************************/ 00158 inline Int TZObject::getRefCounter() const 00159 { 00160 return m_iRefCounter; 00161 } 00162 00163 00164 END_NAMESPACE_Zeus 00165 #endif