list_manager.h

Go 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 
00039         class IListBasicManager : public IBaseGroupType
00040         {
00041         protected:
00042                 IBaseGroupType *_List;
00043         public:
00044                 IListBasicManager();
00045                 IListBasicManager(IBaseGroupType *);
00046                 IListBasicManager(const IListBasicManager &);
00047                 virtual ~IListBasicManager();
00048 
00049 
00051 
00052                 virtual IObjetOp &operator += (const IObjetOp &a);
00053                 virtual IObjetOp &operator -= (const IObjetOp &a);
00054                 virtual IObjectIA &operator = (const IObjectIA &a);
00055 
00056                 virtual const IObjectIA *operator[] (sint32) const;
00057 
00058                 virtual void set(int i,IObjectIA *o)
00059                 {
00060                         _List->set(i,o);
00061                 }
00062 
00063                 virtual bool isTrue() const;
00064 
00065                 virtual IObjetOp *operator ! () const;
00066                 virtual void push(const IObjectIA *o);
00067                 virtual void pushFront(const IObjectIA *o);
00068                 virtual CIteratorContener getIterator()
00069                 {
00070                         return _List->getIterator();
00071                 }
00072 
00073                 virtual CConstIteratorContener getConstIterator() const
00074                 {
00075                         return _List->getConstIterator();
00076                 }
00077                 
00078                 virtual void cpy(const IObjectIA &o);
00079                 virtual const IObjectIA *pop();
00080                 virtual const IObjectIA *get() const;
00081                 virtual const IObjectIA *popFront();
00082                 virtual const IObjectIA *getFront() const;
00083                 virtual sint32 size() const;
00084                 virtual const IObjectIA *find(const IObjectIA &obj) const;
00085                 virtual void eraseFirst(const IObjectIA &obj);
00086                 virtual void eraseAll(const IObjectIA &obj); 
00087                 virtual void erase(const IObjectIA *o); 
00088                 virtual void erase(const IObjectIA &obj);
00089                 virtual void erase(std::list<const IObjectIA *> &l);
00090                 virtual void clear();
00091 
00092                 virtual sint32 getMethodIndexSize() const;
00093                 virtual TQueue isMember(const IVarName *className,const IVarName *methodName,const IObjectIA &p) const;
00094                 virtual IObjectIA::CProcessResult runMethodeMember(sint32, sint32,IObjectIA *);
00095                 virtual IObjectIA::CProcessResult runMethodeMember(sint32,IObjectIA *);
00096 
00097 
00098                 virtual const CProcessResult &run(){return IObjectIA::ProcessRun;}
00099                 virtual bool isEqual(const IBasicObjectIA &a) const;
00100 
00101                 virtual void save(NLMISC::IStream &os);
00102                 virtual void load(NLMISC::IStream &is);
00103                 virtual void getDebugString(std::string &t) const;
00105 
00107                 operator const IBaseGroupType *() const
00108                 {
00109                         return _List;
00110                 }
00111         };
00112 
00113 
00117         class IListManager : public IListBasicManager
00118         {       
00119         public:
00120                 IListManager(IBaseGroupType *);
00121                 IListManager(const IListManager &);
00122                         
00123 
00124                 virtual bool isEqual(const IBasicObjectIA &a) const;            
00125                 virtual CProcessResult sendMessage(IObjectIA *);
00126 
00127 
00128                 virtual void trie() = 0;
00129                 virtual const IObjectIA *getObject(const CObjectIdent &) const = 0;
00130                 
00131                 virtual ~IListManager();
00132 
00133         };
00134 
00138         class CVectorGroupManager: public IListManager
00139         {
00140         public:
00141                 static const NLAIC::CIdentType IdVectorGroupManager;
00142 
00143         public:
00144                 CVectorGroupManager(sint32);
00145                 CVectorGroupManager();
00146                 CVectorGroupManager(const CVectorGroupManager &);
00147                 
00148                 virtual const NLAIC::CIdentType &getType() const;               
00149                 virtual const NLAIC::IBasicType *clone() const;
00150                 virtual const NLAIC::IBasicType *newInstance() const;
00151                 
00152                 virtual void trie();
00153                 virtual const IObjectIA *getObject(const CObjectIdent &) const;
00154 
00155                 virtual ~CVectorGroupManager();
00156         };
00157         
00158 }
00159 #endif

Generated on Tue Mar 16 06:27:45 2004 for NeL by doxygen 1.3.6