Home | nevrax.com |
|
object_type.hGo to the documentation of this file.00001 00007 /* Copyright, 2000 Nevrax Ltd. 00008 * 00009 * This file is part of NEVRAX NEL. 00010 * NEVRAX NEL is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2, or (at your option) 00013 * any later version. 00014 00015 * NEVRAX NEL is distributed in the hope that it will be useful, but 00016 * WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * General Public License for more details. 00019 00020 * You should have received a copy of the GNU General Public License 00021 * along with NEVRAX NEL; see the file COPYING. If not, write to the 00022 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00023 * MA 02111-1307, USA. 00024 */ 00025 #ifndef NL_OBJECT_TYPE_H 00026 #define NL_OBJECT_TYPE_H 00027 00028 00029 namespace NLAIAGENT 00030 { 00039 class CObjectType: public IObjectIA 00040 { 00041 00042 private: 00044 NLAIC::CIdentType *_Type; 00045 00046 public: 00047 CObjectType(NLAIC::CIdentType *type):_Type(type) 00048 { 00049 00050 } 00051 00052 const NLAIC::CIdentType &getType() const 00053 { 00054 if(_Type == NULL) throw NLAIE::CExceptionUnReference(std::string("object type is unreference")); 00055 return *_Type; 00056 } 00057 00058 const NLAIC::IBasicType *clone() const 00059 { 00060 return new CObjectType(new NLAIC::CIdentType (*_Type)); 00061 } 00062 00063 const NLAIC::IBasicType *newInstance() const 00064 { 00065 return clone(); 00066 } 00067 00068 void getDebugString(std::string &txt) const 00069 { 00070 txt += NLAIC::stringGetBuild("CObjectType< _Type < %s > >", (const char *)*_Type); 00071 } 00072 00073 void save(NLMISC::IStream &os) 00074 { 00075 } 00076 00077 void load(NLMISC::IStream &is) 00078 { 00079 } 00080 00081 bool isEqual(const IBasicObjectIA &a) const 00082 { 00083 return *_Type == *((const CObjectType &)a)._Type; 00084 } 00085 00086 const IObjectIA::CProcessResult &run() 00087 { 00088 return IObjectIA::ProcessRun; 00089 } 00090 00091 00092 virtual ~CObjectType() 00093 { 00094 delete _Type; 00095 } 00096 }; 00097 } 00098 00099 00100 #endif |