Main Page | Class Hierarchy | Class List | File List | Class Members

container.h

00001 //-< CONTAINER.H >---------------------------------------------------*--------*
00002 // GigaBASE                  Version 1.0         (c) 1999  GARRET    *     ?  *
00003 // (Post Relational Database Management System)                      *   /\|  *
00004 //                                                                   *  /  \  *
00005 //                          Created:     04-Jun-2000  K.A. Knizhnik  * / [] \ *
00006 //                          Last update: 04-Jun-2000  K.A. Knizhnik  * GARRET *
00007 //-------------------------------------------------------------------*--------*
00008 // B-Tree object container
00009 //-------------------------------------------------------------------*--------*
00010 
00011 #ifndef __CONTAINER_H__
00012 #define __CONTAINER_H__
00013 
00014 BEGIN_GIGABASE_NAMESPACE
00015 
00019 enum SpatialSearchType { 
00020     SPATIAL_SEARCH_EQUAL,
00021     SPATIAL_SEARCH_OVERLAPS,
00022     SPATIAL_SEARCH_SUPERSET,
00023     SPATIAL_SEARCH_PROPER_SUPERSE,
00024     SPATIAL_SEARCH_SUBSET,
00025     SPATIAL_SEARCH_PROPER_SUBSET
00026 };
00027 
00032 class GIGABASE_DLL_ENTRY dbAnyContainer : public dbAnyReference {
00033   protected:
00034     dbFieldDescriptor* fd;
00035 
00036     void create(dbDatabase& db, bool caseInsensitive = false, bool thick = false);
00037     void purge(dbDatabase& db);
00038     void free(dbDatabase& db);
00039     void add(dbDatabase& db, dbAnyReference const& ref);
00040     void remove(dbDatabase& db, dbAnyReference const& ref);
00041     int  search(dbAnyCursor& cursor, void const* from, void const* till, bool ascent = true);
00042     int  spatialSearch(dbAnyCursor& cursor, rectangle const& r, SpatialSearchType type);
00043 
00044     dbAnyContainer(char_t const* fieldName, dbTableDescriptor& desc);
00045 };
00046 
00047 
00051 template<class T>
00052 class dbContainer : public dbAnyContainer {
00053   public:
00062     int search(dbCursor<T>& cursor, void const* from, void const* till, bool ascent = true) {
00063         return dbAnyContainer::search(cursor, from, till, ascent);
00064     }
00071     int search(dbCursor<T>& cursor, void const* key) {
00072         return dbAnyContainer::search(cursor, key, key, true);
00073     }
00074 
00081     int search(dbCursor<T>& cursor, bool ascent = true) {
00082         return dbAnyContainer::search(cursor, NULL, NULL, ascent);
00083     }
00084 
00092     int spatialSearch(dbCursor<T>& cursor, rectangle const& r, SpatialSearchType type) { 
00093         return dbAnyContainer::spatialSearch(cursor, r, type);
00094     }
00095         
00101     void create(bool caseInsensitive = false) {
00102         dbAnyContainer::create(T::dbDescriptor.db, caseInsensitive);
00103     }
00104 
00108     void purge() {
00109         dbAnyContainer::purge(T::dbDescriptor.db);
00110     }
00111 
00115     void free() {
00116         dbAnyContainer::free(T::dbDescriptor.db);
00117     }
00118 
00123     void add(dbReference<T> const& ref) {
00124         dbAnyContainer::add(T::dbDescriptor.db, ref);
00125     }
00126 
00131     void remove(dbReference<T> const& ref) {
00132         dbAnyContainer::remove(T::dbDescriptor.db, ref);
00133     }
00134 
00139     dbContainer(const char_t* fieldName) : dbAnyContainer(fieldName, T::dbDescriptor) {}
00140 };
00141 
00142 END_GIGABASE_NAMESPACE
00143 
00144 #endif
00145 
00146 
00147 
00148 

Generated on Thu Feb 12 18:46:27 2004 for GigaBASE by doxygen 1.3.5