Back to index

lightning-sunbird  0.9+nobinonly
morkSearchRowCursor.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-  */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1999
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #ifndef _MDB_
00039 #include "mdb.h"
00040 #endif
00041 
00042 #ifndef _MORK_
00043 #include "mork.h"
00044 #endif
00045 
00046 #ifndef _MORKNODE_
00047 #include "morkNode.h"
00048 #endif
00049 
00050 #ifndef _MORKENV_
00051 #include "morkEnv.h"
00052 #endif
00053 
00054 #ifndef _MORKCURSOR_
00055 #include "morkCursor.h"
00056 #endif
00057 
00058 #ifndef _MORKSEARCHROWCURSOR_
00059 #include "morkSearchRowCursor.h"
00060 #endif
00061 
00062 #ifndef _MORKUNIQROWCURSOR_
00063 #include "morkUniqRowCursor.h"
00064 #endif
00065 
00066 #ifndef _ORKINTABLEROWCURSOR_
00067 #include "orkinTableRowCursor.h"
00068 #endif
00069 
00070 #ifndef _MORKSTORE_
00071 #include "morkStore.h"
00072 #endif
00073 
00074 #ifndef _MORKTABLE_
00075 #include "morkTable.h"
00076 #endif
00077 
00078 #ifndef _MORKSORTING_
00079 #include "morkSorting.h"
00080 #endif
00081 
00082 #ifndef _MORKROW_
00083 #include "morkRow.h"
00084 #endif
00085 
00086 //3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
00087 
00088 // ````` ````` ````` ````` ````` 
00089 // { ===== begin morkNode interface =====
00090 
00091 /*public virtual*/ void
00092 morkSearchRowCursor::CloseMorkNode(morkEnv* ev) // CloseSearchRowCursor() only if open
00093 {
00094   if ( this->IsOpenNode() )
00095   {
00096     this->MarkClosing();
00097     this->CloseSearchRowCursor(ev);
00098     this->MarkShut();
00099   }
00100 }
00101 
00102 /*public virtual*/
00103 morkSearchRowCursor::~morkSearchRowCursor() // CloseSearchRowCursor() executed earlier
00104 {
00105   MORK_ASSERT(this->IsShutNode());
00106 }
00107 
00108 /*public non-poly*/
00109 morkSearchRowCursor::morkSearchRowCursor(morkEnv* ev,
00110   const morkUsage& inUsage,
00111   nsIMdbHeap* ioHeap, morkTable* ioTable, mork_pos inRowPos)
00112 : morkTableRowCursor(ev, inUsage, ioHeap, ioTable, inRowPos)
00113 // , mSortingRowCursor_Sorting( 0 )
00114 {
00115   if ( ev->Good() )
00116   {
00117     if ( ioTable )
00118     {
00119       // morkSorting::SlotWeakSorting(ioSorting, ev, &mSortingRowCursor_Sorting);
00120       if ( ev->Good() )
00121       {
00122         // mNode_Derived = morkDerived_kTableRowCursor;
00123         // mNode_Derived must stay equal to  kTableRowCursor
00124       }
00125     }
00126     else
00127       ev->NilPointerError();
00128   }
00129 }
00130 
00131 /*public non-poly*/ void
00132 morkSearchRowCursor::CloseSearchRowCursor(morkEnv* ev) 
00133 {
00134   if ( this )
00135   {
00136     if ( this->IsNode() )
00137     {
00138       // morkSorting::SlotWeakSorting((morkSorting*) 0, ev, &mSortingRowCursor_Sorting);
00139       this->CloseTableRowCursor(ev);
00140       this->MarkShut();
00141     }
00142     else
00143       this->NonNodeError(ev);
00144   }
00145   else
00146     ev->NilPointerError();
00147 }
00148 
00149 // } ===== end morkNode methods =====
00150 // ````` ````` ````` ````` ````` 
00151 
00152 /*static*/ void
00153 morkSearchRowCursor::NonSearchRowCursorTypeError(morkEnv* ev)
00154 {
00155   ev->NewError("non morkSearchRowCursor");
00156 }
00157 
00158 morkUniqRowCursor*
00159 morkSearchRowCursor::MakeUniqCursor(morkEnv* ev)
00160 {
00161   morkUniqRowCursor* outCursor = 0;
00162   
00163   return outCursor;
00164 }
00165 
00166 #if 0
00167 orkinTableRowCursor*
00168 morkSearchRowCursor::AcquireUniqueRowCursorHandle(morkEnv* ev)
00169 {
00170   orkinTableRowCursor* outCursor = 0;
00171   
00172   morkUniqRowCursor* uniqCursor = this->MakeUniqCursor(ev);
00173   if ( uniqCursor )
00174   {
00175     outCursor = uniqCursor->AcquireTableRowCursorHandle(ev);
00176     uniqCursor->CutStrongRef(ev);
00177   }
00178   return outCursor;
00179 }
00180 #endif
00181 mork_bool
00182 morkSearchRowCursor::CanHaveDupRowMembers(morkEnv* ev)
00183 {
00184   return morkBool_kTrue; // true is correct
00185 }
00186 
00187 mork_count
00188 morkSearchRowCursor::GetMemberCount(morkEnv* ev)
00189 {
00190   morkTable* table = mTableRowCursor_Table;
00191   if ( table )
00192     return table->mTable_RowArray.mArray_Fill;
00193   else
00194     return 0;
00195 }
00196 
00197 morkRow*
00198 morkSearchRowCursor::NextRow(morkEnv* ev, mdbOid* outOid, mdb_pos* outPos)
00199 {
00200   morkRow* outRow = 0;
00201   mork_pos pos = -1;
00202   
00203   morkTable* table = mTableRowCursor_Table;
00204   if ( table )
00205   {
00206   }
00207   else
00208     ev->NilPointerError();
00209 
00210   *outPos = pos;
00211   return outRow;
00212 }
00213 
00214 //3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789