CollList.cc

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 #include "eyedb_p.h"
00026 #include "ValueCache.h"
00027 #include <assert.h>
00028 #include "AttrNative.h"
00029 
00030 /* CollList */
00031 
00032 namespace eyedb {
00033 
00034   void CollList::init()
00035   {
00036     allow_dup = True;
00037     ordered = True;
00038     type = _CollList_Type;
00039     if (!status)
00040       setClass(CollListClass::make(coll_class, isref, dim, status));
00041   }
00042 
00043   CollList::CollList(const char *n, Class *_class,
00044                      const Oid& _idx1_oid,
00045                      const Oid& _idx2_oid,
00046                      int icnt,
00047                      int _bottom, int _top,
00048                      const IndexImpl *_idximpl,
00049                      Object *_card,
00050                      Bool _is_literal,
00051                      Bool _is_pure_literal,
00052                      Data _idx_data, Size _idx_data_size)
00053     : Collection(n, _class, _idx1_oid, _idx2_oid, icnt,
00054                  _bottom, _top, _idximpl, _card, _is_literal, _is_pure_literal, _idx_data, _idx_data_size)
00055   {
00056     init();
00057     setClass(_class);
00058   }
00059 
00060   CollList::CollList(const char *n, Class *mc, Bool _isref,
00061                      const IndexImpl *_idximpl) :
00062     Collection(n, mc, _isref, _idximpl)
00063   {
00064     init();
00065   }
00066 
00067   CollList::CollList(const char *n, Class *mc, int _dim,
00068                      const IndexImpl *_idximpl) :
00069     Collection(n, mc, _dim, _idximpl)
00070   {
00071     init();
00072   }
00073 
00074   CollList::CollList(Database *_db, const char *n, Class *mc,
00075                      Bool _isref, const IndexImpl *_idximpl) :
00076     Collection(n, mc, _isref, _idximpl)
00077   {
00078     init();
00079     if (!status) 
00080      status = setDatabase(_db);
00081   }
00082 
00083   CollList::CollList(Database *_db, const char *n, Class *mc,
00084                      int _dim, const IndexImpl *_idximpl) :
00085     Collection(n, mc, _dim, _idximpl)
00086   {
00087     init();
00088     if (!status)
00089       status = setDatabase(_db);
00090   }
00091 
00092   CollList::CollList(const CollList& o) : Collection(o)
00093   {
00094     allow_dup = True;
00095     ordered = True;
00096     type = _CollList_Type;
00097   }
00098 
00099   CollList& CollList::operator=(const CollList& o)
00100   {
00101     *(Collection *)this = (Collection &)o;
00102     allow_dup = True;
00103     ordered = True;
00104     type = _CollList_Type;
00105     return *this;
00106   }
00107 
00108   const char *CollList::getClassName() const
00109   {
00110     return CollList_Class->getName();
00111   }
00112 
00113   Status CollList::insert_p(const Oid &, Bool)
00114   {
00115     return Exception::make(IDB_COLLECTION_ERROR,
00116                            "in a list, must use insertFirst, Last, Before or After");
00117   }
00118 
00119   Status CollList::insert_p(const Object *, Bool)
00120   {
00121     return Exception::make(IDB_COLLECTION_ERROR,
00122                            "in a list, must use insertFirst, Last, Before or After");
00123   }
00124 
00125   Status CollList::insert_p(Data val, Bool, Size size)
00126   {
00127     return Exception::make(IDB_COLLECTION_ERROR,
00128                            "in a list, must use insertFirst, Last, Before or After");
00129   }
00130 
00131   Status
00132   CollList::insert(const Value &, Bool noDup)
00133   {
00134     return Exception::make(IDB_COLLECTION_ERROR,
00135                            "in a list, must use insertFirst, Last, Before or After");
00136   }
00137 
00138   Status CollList::insertFirst(const Value &, Collection::ItemId *iid)
00139   {
00140     return Success;
00141   }
00142 
00143   Status CollList::insertFirst_p(const Oid &, Collection::ItemId *iid)
00144   {
00145     return Success;
00146   }
00147 
00148   Status CollList::insertFirst_p(const Object *, Collection::ItemId *iid)
00149   {
00150     return Success;
00151   }
00152 
00153   Status CollList::insertLast(const Value &, Collection::ItemId *iid)
00154   {
00155     return Success;
00156   }
00157 
00158   Status CollList::insertLast_p(const Oid &, Collection::ItemId *iid)
00159   {
00160     return Success;
00161   }
00162 
00163   Status CollList::insertLast_p(const Object *, Collection::ItemId *iid)
00164   {
00165     return Success;
00166   }
00167 
00168   Status CollList::insertBefore_p(Collection::ItemId id, const Oid &item_oid,
00169                                   Collection::ItemId *iid)
00170   {
00171     return Success;
00172   }
00173 
00174   Status CollList::insertBefore_p(Collection::ItemId id, const Object *item_o,
00175                                 Collection::ItemId *iid)
00176   {
00177     return Success;
00178   }
00179 
00180   Status CollList::insertBefore(Collection::ItemId id, const Value &item_val,
00181                                 Collection::ItemId *iid)
00182   {
00183     return Success;
00184   }
00185 
00186   Status CollList::insertAfter_p(Collection::ItemId id, const Oid &,
00187                                Collection::ItemId *iid)
00188   {
00189     return Success;
00190   }
00191 
00192   Status CollList::insertAfter_p(Collection::ItemId id, const Object *,
00193                                Collection::ItemId *iid)
00194   {
00195     return Success;
00196   }
00197 
00198   Status CollList::insertAfter(Collection::ItemId id, const Value &,
00199                                Collection::ItemId *iid)
00200   {
00201     return Success;
00202   }
00203 
00204   Status CollList::replaceAt_p(Collection::ItemId id, const Oid &)
00205   {
00206     return Success;
00207   }
00208 
00209   Status CollList::replaceAt_p(Collection::ItemId id, const Object *)
00210   {
00211     return Success;
00212   }
00213 
00214   Status CollList::replaceAt(Collection::ItemId id, const Value &)
00215   {
00216     return Success;
00217   }
00218 
00219   Status CollList::suppressAt(Collection::ItemId id)
00220   {
00221     return Success;
00222   }
00223 
00224   Status CollList::retrieveAt(Collection::ItemId id, Oid &) const
00225   {
00226     return Success;
00227   }
00228 
00229   Status CollList::retrieveAt(Collection::ItemId id, Object *&, const RecMode *) const
00230   {
00231     return Success;
00232   }
00233 
00234   Status CollList::retrieveAt(Collection::ItemId id, Value &item_value) const
00235   {
00236     return Success;
00237   }
00238 }

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