Home | nevrax.com |
|
list_manager.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_LIST_MANAGER_H 00026 #define NL_LIST_MANAGER_H 00027 00028 #include "nel/ai/agent/agent_object.h" 00029 00030 namespace NLAIAGENT 00031 { 00032 class CObjectIdent; 00033 00034 class IListBasicManager : public IBaseGroupType 00035 { 00036 protected: 00037 IBaseGroupType *_List; 00038 public: 00039 IListBasicManager(); 00040 IListBasicManager(IBaseGroupType *); 00041 IListBasicManager(const IListBasicManager &); 00042 virtual ~IListBasicManager(); 00043 00044 00046 00047 virtual IObjetOp &operator += (const IObjetOp &a); 00048 virtual IObjetOp &operator -= (const IObjetOp &a); 00049 virtual IObjectIA &operator = (const IObjectIA &a); 00050 00051 virtual const IObjectIA *operator[] (sint32) const; 00052 00053 virtual void set(int i,IObjectIA *o) 00054 { 00055 _List->set(i,o); 00056 } 00057 00058 virtual bool isTrue() const; 00059 00060 virtual IObjetOp *operator ! () const; 00061 virtual void push(const IObjectIA *o); 00062 virtual void pushFront(const IObjectIA *o); 00063 virtual CIteratorContener getIterator() 00064 { 00065 return _List->getIterator(); 00066 } 00067 00068 virtual CConstIteratorContener getConstIterator() const 00069 { 00070 return _List->getConstIterator(); 00071 } 00072 00073 virtual void cpy(const IObjectIA &o); 00074 virtual const IObjectIA *pop(); 00075 virtual const IObjectIA *get() const; 00076 virtual const IObjectIA *popFront(); 00077 virtual const IObjectIA *getFront() const; 00078 virtual sint32 size() const; 00079 virtual const IObjectIA *find(const IObjectIA &obj) const; 00080 virtual void eraseFirst(const IObjectIA &obj); 00081 virtual void eraseAll(const IObjectIA &obj); 00082 virtual void erase(const IObjectIA *o); 00083 virtual void erase(const IObjectIA &obj); 00084 virtual void erase(std::list<const IObjectIA *> &l); 00085 virtual void clear(); 00086 00087 virtual sint32 getMethodIndexSize() const; 00088 virtual tQueue isMember(const IVarName *className,const IVarName *methodName,const IObjectIA &p) const; 00089 virtual IObjectIA::CProcessResult runMethodeMember(sint32, sint32,IObjectIA *); 00090 virtual IObjectIA::CProcessResult runMethodeMember(sint32,IObjectIA *); 00091 00092 00093 virtual const CProcessResult &run(){return IObjectIA::ProcessRun;} 00094 virtual bool isEqual(const IBasicObjectIA &a) const; 00095 00096 virtual void save(NLMISC::IStream &os); 00097 virtual void load(NLMISC::IStream &is); 00098 virtual void getDebugString(std::string &t) const; 00100 00102 operator const IBaseGroupType *() const 00103 { 00104 return _List; 00105 } 00106 }; 00107 00108 00109 class IListManager : public IListBasicManager 00110 { 00111 public: 00112 IListManager(IBaseGroupType *); 00113 IListManager(const IListManager &); 00114 00115 00116 virtual bool isEqual(const IBasicObjectIA &a) const; 00117 virtual CProcessResult sendMessage(IObjectIA *); 00118 00119 00120 virtual void trie() = 0; 00121 virtual const IObjectIA *getObject(const CObjectIdent &) const = 0; 00122 00123 virtual ~IListManager(); 00124 00125 }; 00126 00127 class CVectorGroupManager: public IListManager 00128 { 00129 public: 00130 static const NLAIC::CIdentType IdVectorGroupManager; 00131 00132 public: 00133 CVectorGroupManager(sint32); 00134 CVectorGroupManager(); 00135 CVectorGroupManager(const CVectorGroupManager &); 00136 00137 virtual const NLAIC::CIdentType &getType() const; 00138 virtual const NLAIC::IBasicType *clone() const; 00139 virtual const NLAIC::IBasicType *newInstance() const; 00140 00141 virtual void trie(); 00142 virtual const IObjectIA *getObject(const CObjectIdent &) const; 00143 00144 virtual ~CVectorGroupManager(); 00145 }; 00146 00147 class CListGroupManager: public IListManager 00148 { 00149 public: 00150 static const NLAIC::CIdentType IdListGroupManager; 00151 00152 public: 00153 CListGroupManager(); 00154 CListGroupManager(const CListGroupManager &); 00155 00156 virtual const NLAIC::CIdentType &getType() const; 00157 virtual const NLAIC::IBasicType *clone() const; 00158 virtual const NLAIC::IBasicType *newInstance() const; 00159 00160 virtual void trie(); 00161 virtual const IObjectIA *getObject(const CObjectIdent &) const; 00162 00163 virtual ~CListGroupManager(); 00164 }; 00165 } 00166 #endif |