00001 /* 00002 EyeDB Object Database Management System 00003 Copyright (C) 1994-2008 SYSRA 00004 00005 EyeDB is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 EyeDB 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 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 00018 */ 00019 00020 /* 00021 Author: Eric Viara <viara@sysra.com> 00022 */ 00023 00024 00025 #ifndef _EYEDB_COLL_LIST_CLASS_H 00026 #define _EYEDB_COLL_LIST_CLASS_H 00027 00028 namespace eyedb { 00029 00038 class CollListClass : public CollectionClass { 00039 00040 // ---------------------------------------------------------------------- 00041 // CollListClass Interface 00042 // ---------------------------------------------------------------------- 00043 public: 00044 static CollectionClass *make(Class *, Bool, int, Status &); 00045 00051 CollListClass(Class *coll_class, Bool isref); 00052 00058 CollListClass(Class *coll_class, int dim); 00059 00064 CollListClass(const CollListClass &cl); 00065 00071 CollListClass& operator=(const CollListClass &cl); 00072 00077 virtual const char *getPrefix() const {return "list";} 00078 00083 virtual const char *getCSuffix() const {return "CollList";} 00084 00089 virtual Object *clone() const {return new CollListClass(*this);} 00090 00095 virtual CollListClass *asCollListClass() {return this;} 00096 00101 virtual const CollListClass *asCollListClass() const {return this;} 00102 00108 Object *newObj(Database *db = NULL) const; 00109 00116 Object *newObj(Data data, Bool copy = True) const; 00117 00118 // ---------------------------------------------------------------------- 00119 // CollListClass Restricted Access (conceptually private) 00120 // ---------------------------------------------------------------------- 00121 public: 00122 CollListClass(const Oid&, const char *); 00123 }; 00124 00125 class CollListClassPtr : public CollectionClassPtr { 00126 00127 public: 00128 CollListClassPtr(CollListClass *o = 0) : CollectionClassPtr(o) { } 00129 00130 CollListClass *getCollListClass() {return dynamic_cast<CollListClass *>(o);} 00131 const CollListClass *getCollListClass() const {return dynamic_cast<CollListClass *>(o);} 00132 00133 CollListClass *operator->() {return dynamic_cast<CollListClass *>(o);} 00134 const CollListClass *operator->() const {return dynamic_cast<CollListClass *>(o);} 00135 }; 00136 00137 typedef std::vector<CollListClassPtr> CollListClassPtrVector; 00138 00143 } 00144 00145 #endif 00146