00001 /* 00002 ot_lib - Object Type Library 00003 Copyright (C) 2002 Alessandro Bonfanti 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 Alessandro Bonfanti 00020 xjbon@tin.it 00021 */ 00022 00023 00024 #ifndef OT_LIST_H 00025 #define OT_LIST_H 00026 00027 // ----------------------------------------------------------------------------------- 00029 00030 // ----------------------------------------------------------------------------------- 00031 00032 class ot_list : public ot_obj, public list<ot_container_element> 00033 { 00034 00035 private: 00036 00037 public: 00038 00039 00040 // ######################################### 00041 // CONSTRUCTORS & DESTRUCTOR 00042 // ######################################### 00043 00045 ot_list(void); 00046 00049 ot_list(const ot_list &c); 00050 00052 virtual ~ot_list(); 00053 00054 00055 // ######################################### 00056 // IMPLEMENTATIONS OF THE VIRTUAL FUNCTIONS 00057 // ######################################### 00058 00062 ot_obj *dup(void) const; 00063 00067 void asXml(ostream &s=cout,int i=0) const; 00068 00071 bool asData(ostream &s) const; 00072 00073 00074 // ######################################### 00075 // PROPIETARY FUNCTIONS 00076 // ######################################### 00077 00079 00080 00081 00082 bool erase(const ot_obj *o); 00083 00084 // ######################################### 00085 // MATH OPERATOR 00086 // ######################################### 00087 00089 ot_list & operator = (const ot_list &c); 00090 00092 bool operator == (const ot_list &c); 00093 00095 bool operator != (const ot_list &v); 00096 00098 bool operator == (const ot_obj *o) const 00099 { 00100 if(o && o->getType()==getType()) return(*this==*((ot_list *) o)); 00101 else return(false); 00102 } 00103 00104 }; 00105 00106 #endif