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_BAG_CLASS_H 00026 #define _EYEDB_COLL_BAG_CLASS_H 00027 00028 namespace eyedb { 00029 00038 class CollBagClass : public CollectionClass { 00039 00040 // ---------------------------------------------------------------------- 00041 // CollBagClass Interface 00042 // ---------------------------------------------------------------------- 00043 public: 00044 static CollectionClass *make(Class *, Bool, int, Status &); 00045 00051 CollBagClass(Class *coll_class, Bool isref); 00052 00058 CollBagClass(Class *coll_class, int dim); 00059 00064 CollBagClass(const CollBagClass &cl); 00065 00071 CollBagClass& operator=(const CollBagClass &cl); 00072 00073 virtual const char *getPrefix() const {return "bag";} 00074 virtual const char *getCSuffix() const {return "CollBag";} 00075 00080 virtual Object *clone() const {return new CollBagClass(*this);} 00081 00086 virtual CollBagClass *asCollBagClass() {return this;} 00087 00092 virtual const CollBagClass *asCollBagClass() const {return this;} 00093 00099 Object *newObj(Database *db = NULL) const; 00100 00107 Object *newObj(Data data, Bool copy = True) const; 00108 00109 // ---------------------------------------------------------------------- 00110 // CollBagClass Restricted Access (conceptually private) 00111 // ---------------------------------------------------------------------- 00112 public: 00113 CollBagClass(const Oid&, const char *); 00114 }; 00115 00116 class CollBagClassPtr : public CollectionClassPtr { 00117 00118 public: 00119 CollBagClassPtr(CollBagClass *o = 0) : CollectionClassPtr(o) { } 00120 00121 CollBagClass *getCollBagClass() {return dynamic_cast<CollBagClass *>(o);} 00122 const CollBagClass *getCollBagClass() const {return dynamic_cast<CollBagClass *>(o);} 00123 00124 CollBagClass *operator->() {return dynamic_cast<CollBagClass *>(o);} 00125 const CollBagClass *operator->() const {return dynamic_cast<CollBagClass *>(o);} 00126 }; 00127 00128 typedef std::vector<CollBagClassPtr> CollBagClassPtrVector; 00129 00134 } 00135 00136 #endif