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_ARRAY_CLASS_H 00026 #define _EYEDB_COLL_ARRAY_CLASS_H 00027 00028 namespace eyedb { 00029 00038 class CollArrayClass : public CollectionClass { 00039 00040 // ---------------------------------------------------------------------- 00041 // CollArrayClass Interface 00042 // ---------------------------------------------------------------------- 00043 public: 00044 static CollectionClass *make(Class *, Bool, int, Status &); 00045 00051 CollArrayClass(Class *coll_class, Bool isref); 00052 00058 CollArrayClass(Class *coll_class, int dim); 00059 00064 CollArrayClass(const CollArrayClass &cl); 00065 00071 CollArrayClass& operator=(const CollArrayClass &cl); 00072 00077 virtual const char *getPrefix() const {return "array";} 00078 00083 virtual const char *getCSuffix() const {return "CollArray";} 00084 00089 virtual Object *clone() const {return new CollArrayClass(*this);} 00090 00095 virtual CollArrayClass *asCollArrayClass() {return this;} 00096 00101 virtual const CollArrayClass *asCollArrayClass() const {return this;} 00102 00108 Object *newObj(Database *db = NULL) const; 00109 00116 Object *newObj(Data data, Bool copy = True) const; 00117 00118 // ---------------------------------------------------------------------- 00119 // CollArrayClass Restricted Access (conceptually private) 00120 // ---------------------------------------------------------------------- 00121 public: 00122 CollArrayClass(const Oid&, const char *); 00123 }; 00124 00125 class CollArrayClassPtr : public CollectionClassPtr { 00126 00127 public: 00128 CollArrayClassPtr(CollArrayClass *o = 0) : CollectionClassPtr(o) { } 00129 00130 CollArrayClass *getCollArrayClass() {return dynamic_cast<CollArrayClass *>(o);} 00131 const CollArrayClass *getCollArrayClass() const {return dynamic_cast<CollArrayClass *>(o);} 00132 00133 CollArrayClass *operator->() {return dynamic_cast<CollArrayClass *>(o);} 00134 const CollArrayClass *operator->() const {return dynamic_cast<CollArrayClass *>(o);} 00135 }; 00136 00137 typedef std::vector<CollArrayClassPtr> CollArrayClassPtrVector; 00138 00143 } 00144 00145 #endif 00146