CollSetClass.h

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

Generated on Mon Dec 22 18:15:52 2008 for eyedb by  doxygen 1.5.3