OOFILE  1.9
oof1.h
Go to the documentation of this file.
1 #ifndef H_OOF1
2 #define H_OOF1
3 
4 // COPYRIGHT 1994 A.D. Software, All rights reserved
5 
6 // public layer of OOFILE database
7 
8 // NOTE inline definitions included at end of this header file
9 
10 // see misc.txt for code conventions
11 #ifndef H_OOF0
12  #include "oof0.h"
13 #endif
14 #ifndef H_OOFMSG
15  #include "oofmsg.h"
16 #endif
17 #ifdef _Macintosh
18  #if defined _Macintosh_Carbon
19  #ifndef __CARBON__
20  #ifdef _Macintosh_Mach
21  #include <Carbon/Carbon.h>
22  #else
23  # include <Carbon.h>
24  #endif
25  #endif
26  #else
27  #include <Types.h>
28  #include <Events.h>
29  #include <Files.h>
30  #endif
31 #endif
32 #if OOF_USE_ANSI_STREAMS && !defined(H_OOFIOS)
33  #include "oofios.h"
34 #endif
35 #ifndef H_OOFSTR
36  #include "oofstr.h"
37 #endif
38 
39 
41 class oofE_Base;
42 
50 public:
51  bool hidden() const { return mHidden; };
52  void hide(bool hideIt=true) { mHidden = hideIt; };
53 #ifndef OOF_NO_STDLIB
54  virtual void describe(std::ostream&) const;
55 #endif
56  virtual oofString name() const;
57  virtual ~OOF_PublicBase() {};
58 
59 protected:
60  OOF_PublicBase() : mHidden(false) {};
61  OOF_PublicBase(const OOF_PublicBase& rhs) : mHidden(rhs.mHidden) {};
62 
63  bool mHidden;
64 };
65 
71 
72 
83 public:
84  void incRefs();
85  void decRefs();
86 protected:
87  OOF_mixRefCount(unsigned long initialRefs = 1);
88  virtual ~OOF_mixRefCount();
89 // use default copy ctor
90  unsigned int mReferences;
91 };
92 
102 public:
103  void incRefs();
104  void decRefs();
105 protected:
106  OOF_mixRefCountWithCopy(unsigned long initialRefs = 1);
108  const OOF_mixRefCountWithCopy& operator=(const OOF_mixRefCountWithCopy&);
109  virtual ~OOF_mixRefCountWithCopy();
110  virtual void CleanupOnLastDereference()=0;
111 // use default copy ctor
112  unsigned int* mSharedReferences;
113  unsigned int mTimesDecCalled;
114 };
115 
116 
122 private:
123  OOF_DictRep(unsigned int numSlots, unsigned int expandBySlots);
124  OOF_DictRep(const OOF_DictRep*);
125  ~OOF_DictRep();
126  void operator=(const OOF_DictRep&) {assert(0);} //lint !e1529 not first checking assignment to this
127 
128 // access protocol
129  void Append(OOF_bitPointer);
130  OOF_bitPointer Pop();
131 
132  OOF_bitPointer& operator[](unsigned int index);
133  OOF_bitPointer& operator[](const char *name);
134  OOF_bitPointer& lookupByAttribute(const char* attributeValue, const char* attributeType=0);
135  OOF_bitPointer& item(unsigned int index);
136  OOF_bitPointer value(unsigned int index) const;
137  void Reset();
138  void ExpandToInclude(unsigned int indexToCover);
139 
140 // data storage
141  enum {kSlotSize=sizeof(OOF_bitPointer)};
142  OOF_bitPointer *mBits; // owned
143  unsigned int mExpansionChunk, mNextFreeEntry, mNumSlots;
144 
145  friend class OOF_Dictionary;
146  friend class dbView;
147  friend class dbRelChain;
148 };
149 
150 
160 // default constructor, or passing in zero items skips allocating storage
161 // and storage will be allocated later as necessary.
162 public:
163  enum {kDefExpansionChunk=10};
164 
165  OOF_Dictionary() ;
166  OOF_Dictionary(const OOF_DictRep* rep);
167  OOF_Dictionary(unsigned int numSlots);
168  OOF_Dictionary(unsigned int numSlots, unsigned int expansionChunk, bool inOwnsContents=false);
170  OOF_Dictionary clone() const;
171  virtual ~OOF_Dictionary();
172  OOF_Dictionary& operator=(const OOF_Dictionary&);
173 
174 // access operators
175  OOF_bitPointer& operator[](unsigned int);
176  OOF_bitPointer& operator[](const char*); // may return OOF_Dictionary::missingItem() if fails to match name
177  OOF_bitPointer& lookupByAttribute(const char* attributeValue, const char* attributeType=0);
178 
179  OOF_bitPointer& item(unsigned int index);
180  OOF_bitPointer value(unsigned int index) const;
181  OOF_bitPointer& operator()();
182 
183  void append(OOF_bitPointer);
184  OOF_bitPointer pop(); // returns last item, maybe 0
185 
186  void reset();
187 
188  // iterator protocol
189  unsigned int iter() const;
190  void start();
191  bool more() const;
192  void next();
193  unsigned int count() const;
194 
195  void startVisible(bool wantVisible=true);
196  bool moreVisible(bool wantVisible=true);
197  void nextVisible(bool wantVisible=true);
198  unsigned int countVisible(bool wantVisible=true);
199 
200 // other protocol
201  bool allObjectsMatch(OOF_Dictionary&);
202  void deleteAll();
203 #ifndef OOF_NO_STDLIB
204  virtual void describe(std::ostream&) const;
205  virtual void describeVisible(std::ostream&, bool wantVisible) const;
206 #endif
207  void ownsContents(bool ownsFlag=true);
208 
209 protected:
210  bool EntryMatchesVisibility(const OOF_PublicBase*, bool) const;
211 
212 // data storage
213  OOF_DictRep *mRep; // owned
214  unsigned int mInternalIter;
217 
218 public:
219  static OOF_bitPointer& missingItem();
220 };
221 
222 
229 typedef unsigned long oidT;
230 
231 
245  kIndexCompressPaddingNoDups = kIndexCompressPadding + kIndexNoDups,
247  };
248 /* NEW VERSION
249 enum OOF_IndexOptions { kNotIndexed=0, kIndexed=1, kIndexedNoDups=2, kIndexedCaseSensitive=4,
250  kIndexedCompressLeading=8, kIndexedCompressPadding=16,
251  kIndexedCompress = kIndexedCompressLeading + kIndexedCompressPadding,
252  kIndexedCompressNoDups = kIndexedCompress + kIndexedNoDups,
253  kIndexedCompressLeadingNoDups = kIndexedCompressLeading + kIndexedNoDups,
254  kIndexedCompressPaddingNoDups = kIndexedCompressPadding + kIndexedNoDups
255  };
256  */
257 // for backwards compatability and to balance things out so we have both a verb and noun form
258 // (the original one is as follows except for kNotIndexed and kIndexed
259 /*enum OOF_IndexOptions2 { kNotIndex=0, kIndex=1, kIndexNoDups=2, kIndexCaseSensitive=4,
260  kIndexCompressLeading=8, kIndexCompressPadding=16,
261  kIndexCompress = kIndexCompressLeading + kIndexCompressPadding,
262  kIndexCompressNoDups = kIndexCompress + kIndexNoDups,
263  kIndexCompressLeadingNoDups = kIndexCompressLeading + kIndexNoDups,
264  kIndexCompressPaddingNoDups = kIndexCompressPadding + kIndexNoDups
265  };
266  */
267 OOFILE_EXPORT std::ostream& operator<<(std::ostream&, OOF_IndexOptions);
268 
269 
270 #if defined(_MSC_VER) && !defined(__MWERKS__)
271  // VC5 considers field(0) ambiguous - sloppy evaluation of overloads!!!
272  typedef int tableNumT;
273  typedef int fieldNumT;
274 #else
275  typedef unsigned short tableNumT; // never more than 64k classes in database!
276  typedef unsigned short fieldNumT; // never more than 64k fields in a record!
277 #endif
278 
279 class dbQueryClause;
280 class dbRelRefBase;
281 class dbField;
282 class OOF_tableBackend;
283 class dbContext;
284 class dbConnect;
286 class dbSorter;
287 class OOF_Selection;
288 class dbTable;
289 class dbGUI;
290 class oofWordParser;
291 class oofDirectory;
292 
293 
299 public:
300  dbGUIFactory();
301  virtual dbGUI* concreteMakeGUI(dbTable*)=0;
302  static dbGUI* makeGUI(dbTable*);
303 
304 protected:
306 
307 };
308 
309 
317 // public interface to selections
318 public:
319  dbSelection();
320  dbSelection(const OOF_Selection*);
321  dbSelection(const dbSelection&);
322  ~dbSelection();
323 
324  dbSelection& operator=(const dbSelection&);
325  dbSelection& operator=(dbTable&);
326 
327 
329 
330  void difference_with(const dbSelection&);
331  void difference_with(dbTable&);
332  void difference_with(dbTable*);
333  void operator -=(const dbSelection&);
334  void operator -=(dbTable&);
335  void operator -=(dbTable*);
336  void operator %=(const dbSelection&);
337  void operator %=(dbTable&);
338  void operator %=(dbTable*);
339 
340  void intersection_with(const dbSelection&);
341  void intersection_with(dbTable&);
342  void intersection_with(dbTable*);
343  void operator &=(const dbSelection&);
344  void operator &=(dbTable&);
345  void operator &=(dbTable*);
346 
347  void union_with(const dbSelection&);
348  void union_with(dbTable&);
349  void union_with(dbTable*);
350  void union_with_no_overlap(const dbSelection&);
351  void union_with_no_overlap(dbTable&);
352  void union_with_no_overlap(dbTable*);
353  void operator +=(const dbSelection&);
354  void operator +=(dbTable&);
355  void operator +=(dbTable*);
356  void operator |=(const dbSelection&);
357  void operator |=(dbTable&);
358  void operator |=(dbTable*);
359 
360  void union_with(oidT);
361  void operator+=(oidT);
362  void intersection_with(oidT);
363 
364  void invert();
365  void operator~();
366  void operator!();
368 
370 
371  bool isEmpty() const;
372  bool isAllRecs() const;
373  bool contains(oidT) const;
374  unsigned long count() const;
375  const OOF_Selection* internalSelection() const;
376  const dbTable* prototypicalTable() const;
378 
379 private:
380  void DeleteContents();
381 
382 // data storage
383  OOF_Selection* mSelection; // owned
384  unsigned long* mReferences;
385 };
386 
387 
393 public:
396  virtual ~stSaveSelection();
397 
398 protected:
401 };
402 
403 
410 public:
414 
415 protected:
417 };
418 
419 
433 public:
434  dbTableAssigner(dbTable*, const char* inFirstFieldValue);
435  ~dbTableAssigner();
436 
437  dbTableAssigner& operator<<(const char*);
438  void setNextFieldString(const char*);
439 
440 protected:
442  fieldNumT mNextFieldNum;
443 };
444 
445 
453 public:
454  dbTable(const char *name=0);
455  dbTable(const dbTable&);
456  dbTable(const dbTable&, OOF_tableBackend*);
457  virtual ~dbTable();
458  void stillCurrentlyConstructing();
459  dbTable* prototype() const;
460 
461  enum {kFieldSep = '\t'};
462  enum {kRecSep = '\n'};
463  enum selSharingT {selNotShared, selShared, selCopyOnWrite,selNotSharedCacheCopied};
464  enum saveOptionsT{requireExplicit, autoOnContextChange, requireExplicitAndBuffer, bufferForever};
465  enum tableValidT {eInvalid=0, eValid, eClosed}; // use invalid=0 so can cope if coerce false
466 
467  virtual const char* defaultName() const { return ""; }; // gets overridden by the methods generated by ABSTRACT_BASE_METHODS in oofmacro.h
468  virtual oofString name() const;
469  void setName(const char*);
470  virtual dbTable* cloneTableSharingSelection() const;
471  virtual dbTable* cloneTableWithoutSelection() const;
472  virtual dbTable* cloneTbleWithCachNoSelection() const;
473 
474 
475  virtual dbTable* cloneTable(selSharingT selSharing=selCopyOnWrite)=0;
476 
481  virtual dbTable* cloneTableConst(selSharingT selSharing) const=0;
482 
483  void postCloneTableCleanup();
484 // operator dbTable*();
485 
486  virtual dbView* makeView(); // can't be const because the view retains a pointer to us
487 
488  bool ensureRecordLoaded(bool autoCreateRelated=false, bool failureAborts=true);
489  void ensureSelectionLoaded();
490  void relateAllDeletables();
491 
492  // hiding oid's which may be record offsets or generated unique numbers
493  oidT currentOID();
494  oidT oidOfRecord(unsigned long);
495 
496 // other protocol
497  bool loadRelatedContextJoiningFromTo(const dbField*, const dbField*);
498 
499 
500  oofWordParser* getDefaultWordParser();
501  void setDefaultWordParser(oofWordParser* inParser) ;
502 
503  void setSaveOption(const saveOptionsT);
504  void setFileExtensions(const char* dataExt, const char* indexExt);
505 
506  bool pointsToBackend(const OOF_tableBackend*) const;
507  virtual bool canSaveRecord(); // expect user override in many cases
508 
509  void attachfield(dbField*);
510  void buildSchema();
511  void addIndices(const char* newIDXname);
512  void suppressIndices();
513  void rebuild();
514  void close();
515  void deleteStorage();
516  void createTableInConnection(const dbConnect*);
517  bool openTableInConnection(const dbConnect*, const bool createIfMissing = false);
518  unsigned int numIndexes() const;
519  unsigned int numFiles() const;
520  unsigned long sequenceNumber() const;
521  void setTableValid(bool isValid=true);
522  void pack();
523 
525 
526  void start();
527  void next();
528  void first();
529  void prev();
530  void last();
531 
532  bool more() const;
533  bool atFirst() const;
534  bool atLast() const;
535  bool atRelative(unsigned long) const;
536 
537  unsigned long count();
538  unsigned long countAll() const;
540 
541 
543 
544  void setSortOrder(const dbField&, bool shouldReverse=false);
545  void setSortOrder(const dbSorter&);
546  void setReverseSortOrder(const dbField&);
547  dbSorter* sorter() const;
548  void sortNow() const;
549  void unSorted();
550  void suspendSorting();
551  void resumeSorting();
553 
555 
556  void unloadRecord();
557  bool reloadRecord();
558  void markDirty();
560 
562 
563  bool isRecordLoaded() const;
564  bool isEmpty();
565  bool isNewRecord() const;
566  bool isTableValid() const;
567  tableValidT validStatus() const;
568  int validatingDepth() const;
569  bool allSelected() const;
570  bool isDirty() const;
572 
573 
575 
576  void ignoreDuplicateRecords();
577  void noticeDuplicateRecords();
579 
580 
582 
583  unsigned long recordNumber() const;
584  unsigned long recordNumberOfOID(oidT inOID);
585  unsigned long recordNumber(const dbQueryClause* qClause, bool* outFoundIt=0) const;
586  unsigned long recordNumber(const dbQueryClause& qClause, bool* outFoundIt=0) const;
587  bool gotoRecord(unsigned long);
589 
590 
592 
593  dbQueryBinaryNofield hasWord(const char* str) const;
594  dbQueryBinaryNofield hasAnyWordsDelimited(const char*, char delimiter);
595  dbQueryBinaryNofield hasAllWordsDelimited(const char*, char delimiter);
596  dbQueryBinaryNofield hasAnyWordsOf(const char **schStrs, unsigned long count);
597  dbQueryBinaryNofield hasAllWordsOf(const char **schStrs, unsigned long count);
598  dbQueryBinaryNofield hasAnyWordsOf(oofWordParser*);
599  dbQueryBinaryNofield hasAllWordsOf(oofWordParser*);
600 
601  dbQueryBinaryNofield hasWordStartsWith(const char* str) const;
602  dbQueryBinaryNofield hasAnyWordsStartsWithDelimited(const char*, char delimiter);
603  dbQueryBinaryNofield hasAllWordsStartsWithDelimited(const char*, char delimiter);
604  dbQueryBinaryNofield hasAnyWordsStartsWithOf(const char **schStrs, unsigned long count);
605  dbQueryBinaryNofield hasAllWordsStartsWithOf(const char **schStrs, unsigned long count);
606  dbQueryBinaryNofield hasAnyWordsStartsWithOf(oofWordParser*);
607  dbQueryBinaryNofield hasAllWordsStartsWithOf(oofWordParser*);
609 
611 
612  bool search(const dbQueryClause& query);
614  bool searchSelection(const dbQueryClause& query);
615  bool search(const dbQueryClause* query);
616  bool searchSelection(const dbQueryClause* query);
617  bool searchSelContainsAnyDelimited(const dbField& schField, const char *schStr, char delim);
618  bool searchSelContainsAnyOf(const dbField& schField, const char **schStrs, unsigned long count);
619  bool searchSelContainsAnyOf(const dbField& schField, oofWordParser*);
620  bool searchSelContainsAllDelimited(const dbField& schField, const char *schStr, char delim);
621  bool searchSelContainsAllOf(const dbField& schField, const char **schStrs, unsigned long count);
622  bool searchSelContainsAllOf(const dbField& schField, oofWordParser*);
624 
625 
627 
628  void difference_with(dbTable&);
629  void difference_with(dbTable*);
630  void difference_with(const dbSelection&);
631  void operator -=(dbTable&);
632  void operator -=(dbTable*);
633  void operator -=(const dbSelection&);
634  void operator %=(dbTable&);
635  void operator %=(dbTable*);
636  void operator %=(const dbSelection&);
637 
638  void intersection_with(dbTable&);
639  void intersection_with(dbTable*);
640  void intersection_with(const dbSelection&);
641  void operator &=(dbTable&);
642  void operator &=(dbTable*);
643  void operator &=(const dbSelection&);
644 
645  void union_with(dbTable&);
646  void union_with(dbTable*);
647  void union_with(const dbSelection&);
648  void union_with_no_overlap(dbTable&);
649  void union_with_no_overlap(dbTable*);
650  void union_with_no_overlap(const dbSelection&);
651  void operator +=(dbTable&);
652  void operator +=(dbTable*);
653  void operator +=(const dbSelection&);
654  void operator |=(dbTable&);
655  void operator |=(dbTable*);
656  void operator |=(const dbSelection&);
657 
658  void invert();
659  void operator~();
660  void operator!();
661 
662  bool operator+=(oidT);
663  bool addOIDtoSelection(oidT);
664  bool contains(oidT);
665  void dropRecordFromSelection(unsigned long);
667 
669 
670  dbSelection currentSelection();
671  dbSelection makeEmptySelection() const;
672  void setSelection(const dbSelection&);
673  void setSelection(const OOF_Selection*);
674  const dbSelection& operator=(const dbSelection& rhs);
676 
677 
679 
680  void appendSelection(const dbSelection&);
681  void removeSelection(const dbSelection&);
682  void clearSelection();
684 
686 
687  void selectAll();
688  void selectNone();
689  bool selectJustOID(oidT);
690  void selectJustCurrent();
691  bool relateSelectionFrom(dbTable*);
692  bool selectAllRelated(bool broadcastChange=true);
694 
696 
697  virtual void newRecord();
698  virtual void cloneRecord();
699  virtual void postCloneRecordCleanup();
700  virtual void saveRecord();
701  virtual void revertRecord();
702  virtual void deleteRecord();
703  void deleteSelection();
704  void deleteAll();
705  void copyAllFrom(dbTable*);
706  dbTableAssigner operator<<(const char*);
707 
708  void copyRecFrom(const dbTable* rhs, fieldNumT numFields=0);
709  dbTable& operator=(const dbTable&);
710 
711  virtual void extract(std::ostream&);
712  virtual unsigned long insert(std::istream&);
713  virtual void import(const char* ansiFileName);
714  bool allowsShortImports() const;
715  void setShortImports(bool);
717 
719 
720  const oofString& tableName() const;
721  virtual oofString tableSingularName() const; // eg: returns Student if you have name Students
722  tableNumT tableNumber() const;
723  bool tableCachesDirtyRecords() const;
724  saveOptionsT tableSaveOption() const;
725  virtual void describe(std::ostream&) const;
726  virtual void describeState(std::ostream&) const;
727  virtual void stats(std::ostream&);
728  bool isCopyCompatibleWith(const dbTable*) const;
729  fieldNumT numFields() const;
730  dbField* field(fieldNumT) const;
731  dbField* field(const oofString& );
732  bool isOpen() const;
733  bool inDeclarativePhase() const;
735 
737 
738  bool isRelatedClone() const;
739  dbRelRefBase* controllingRelationship() const;
740  dbTable* lhsTableInRelationshipSpec() const;
741  dbTable* baseTableOfRelationChain();
743 
744  dbGUI* getGUI();
745 
746  virtual void generateTestData(unsigned long numRecords, bool generateRandom=true, unsigned long seedOrCount=0);
747 
749 
750  void lockRecord(); // no return type - throws exception
751  void unlockRecord();
752  bool lockedCurrentRecord() const;
754 
755 
757 
758  void beginTransaction(short tMode =0);
759  void abortTransaction(short rMode =0);
760  void commitTransaction(short rMode =0);
761  bool transactionDirty();
763 
764 #ifndef OOF_DISALLOW_CHANGE_SHIELDING
765 // change shielding, so field changes don't mark the record as dirty (default is false)
766  bool changeShielded() const;
767  void changeShielded(bool setShielding=true);
768 #endif
769 
770 
771 void describeInvariant(std::ostream& os) const; //To pass in an output stream as a parameter
772 
773 protected:
774 #ifdef OOF_DEBUG_LOG_NAME
775  void StandardDebugLog(const char*) const;
776  void StandardQueryDebugLog(const char*, const dbQueryClause&) const;
777 #endif
778 
779 private:
780  void CompleteField(dbField*);
781  void ContextChange();
782  void MakeTableValid();
783  void LoadRelatedContext();
784  void SaveLoop();
785 
786 // data storage
787 protected:
788  OOF_tableBackend *mBackend; // owned (the bit that does all the work!!)
791  tableNumT mTableNumber;
792  fieldNumT mFieldCount;
797  dbGUI* mGUI; // owned
798 
799 private:
800  dbRelRefBase* mRelToLHS; // if we are a clone managing a related selection, this is how we get back
801  oofWordParser* mDefaultPrototypeParser;
802  dbConnect* mConnection;
803  dbTable* mPrototype;
804  bool mLockedCurrentRecord;
805  bool mInTransaction;
806  bool mTransactionDirty;
807 
808  bool mInSaveLoop;
809 #ifndef OOF_DISALLOW_CHANGE_SHIELDING
810  bool mChangeShielded;
811 #endif
812 
813  static dbGUIFactory* sGUIFactory;
814 
815 protected:
817 
818  friend class dbField;
819  friend class dbConnect;
820  friend class dbConnect_ram;
821  friend class dbConnect_ramp;
822  friend class dbRelHalf;
823  friend class dbRelRefBase;
824  friend class OOF_tableBackend;
826  friend class oofE_Table;
827 }; // dbTable
828 OOFILE_EXPORT std::ostream& operator<<(std::ostream& os, dbTable& tbl);
829 OOFILE_EXPORT std::ostream& operator<<(std::ostream& os, dbTable* tbl);
830 OOFILE_EXPORT std::istream& operator>>(std::istream& is, dbTable* tbl);
831 OOFILE_EXPORT std::istream& operator>>(std::istream& is, dbTable& tbl);
832 
833 
840 public: // for convenience but really only update by dbTable or subclasses
841  static bool sCloning;
844 };
845 
846 
853 public:
855  virtual ~oofErrorReporter();
856 
857 // default implementations
858  virtual void raise(std::ostream&, bool terminateAfterMsg=true);
859  virtual void raise(const char*, bool terminateAfterMsg=true);
860 
861  static oofErrorReporter* defaultReporter();
862  static void setDefaultReporter(oofErrorReporter*);
863 
864 protected:
865  virtual void MaybeTerminate(bool terminateAfterMsg);
866 
867 private:
868  static oofErrorReporter sDefaultReporter; // concrete default
869  static unsigned short sNumReporters;
870  static oofErrorReporter* sUserSpecifiedReporter;
871 };
872 
873 
879 public:
880  oofCGIErrorReporter(std::ostream&);
881  virtual ~oofCGIErrorReporter();
882 
883  virtual void raise(std::ostream&, bool terminateAfterMsg=true);
884  virtual void raise(const char*, bool terminateAfterMsg=true);
885 
886 protected:
887  virtual void Header();
888  virtual void Footer();
889 
890 private:
891  std::ostream& mStream;
892 };
893 
894 
901 public:
902  enum oofRuntimeEnvT {Macintosh, OS2, Unix, WinNT, Win95, Win98, Win32s, Win3, Win_UNKNOWN};
903 // NOT YET IMPLEMENTED - tests for OS2
904 
905  static oofRuntimeEnvT runtimeEnv();
906  static bool isMacintosh();
907  static bool isUnix();
908  static bool isWindows();
909  static const char* termForLink();
910  static void spendBackgroundTime();
911  static void beep();
912 };
913 
914 
921 public:
922  dbConnect(bool isTemporary=false);
923  virtual ~dbConnect();
924 
925 private:
926  dbConnect(const dbConnect&) { assert(0); } //lint !e1538 not include base in init list // NEVER CALLED - MAKE IMPOSSIBLE TO COPY
927  void operator=(const dbConnect&) { assert(0); } //lint !e1529 not first checking assignment to this // MAKE IMPOSSIBLE TO COPY
928 
929 public:
930  virtual oofString name() const;
931  static dbConnect* currentlyConstructing();
932 
933  virtual void newConnection(const char* connectionName)=0;
934  virtual void openConnection(const char* connectionName)=0;
935 
936 #ifdef _Macintosh
937  virtual void newConnection(const FSSpec&)=0;
938  virtual void openConnection(const FSSpec&)=0;
939 #endif
940  virtual void close()=0;
941  virtual void deleteStorage();
942  virtual bool usesSeparateStorageFiles() const;
943 
944  void gotoDatabaseDir() const;
945  oofDirectory* databaseDirectory() const;
946  const oofString& connectionName() const;
947  void attachTable(dbTable *);
948  dbTable *table(unsigned int) const;
949  dbTable *table(const char*);
950  unsigned int numTables() const;
951  bool isOpen() const;
952  bool inDeclarativePhase() const;
953 
954 // locking
955  virtual void exitLocking()=0;
956  virtual void enterWriteLocking()=0;
957  virtual void enterReadLocking()=0;
958 
959 // utilities
960  static bool fileExists(const char * fName); // legacy call - use oofDirectory::fileExists
961  static bool underConstruction();
962  virtual void describe(std::ostream&) const;
963  virtual void writeOOFSchema();
964  virtual void readOOFSchema(const oofString& schemaFileName);
965  virtual void stats(std::ostream&);
966  void dumpData(std::ostream&);
967  void extract(std::ostream& os) {dumpData(os);}; // dumpData is old form, extract is more consistent
968  void copyAllFrom(dbConnect*);
969  void deleteAll();
970  void generateTestData(unsigned long maxRecs=10000, bool generateRandom=true, unsigned long seedOrCount=0);
971  static void raise(std::ostream&, bool terminateAfterMsg=true);
972  static void raise(const char*, bool terminateAfterMsg=true);
973  void schemaFileExt(const oofString&);
974 #ifndef OOF_USING_EXCEPTIONS
975  static void raise(const oofE_Base&, bool terminateAfterMsg=true);
976 #endif
977 
978 // batch settings
979  void suspendSorting() const;
980  void resumeSorting() const;
981 
982 // settings
983  static void truncateTrailingSpaces(bool willTruncate=true);
984  static bool willTruncateTrailingSpaces();
985 #ifdef OOF_DEBUG_LOG_NAME
986  static std::ostream& debugLog();
987  static void startDebugWrite();
988  static void logComment(const char*);
989  static void logComment(std::ostream&);
990  static void endDebugWrite();
991 #endif
992 
993  oofWordParser* getDefaultWordParser();
994  void setDefaultWordParser(oofWordParser* inParser) ;
995 
996 protected:
997  void MakeAllTablesValid() const;
998  void InitOpenOrCreateState();
999  void OpenOrCreateStateTransition(bool inOpenedOrCreated);
1000  enum connectionFileStateT {// has both transition and state
1002  eStart=1,
1003  eOpenedFile=2,
1004  eCreatedFile=4,
1005  eInvalidlyOpenInCreation = 8,
1006  eInvalidlyCreationInOpen = 16
1007  };
1008 #ifdef OOF_DEBUG_LOG_NAME
1009  void LogConnection(const char* comment, const char* connectionName);
1010 #endif
1011  virtual void WriteOOFSchemaFile();
1012  virtual oofString MakeSchemaFileName();
1013  oofString MakeOOFSchemaString();
1014 private:
1015 
1016  virtual OOF_tableBackend *MakeTableBackend(dbTable*)=0;
1017 
1018 // data storage
1019 protected:
1023  bool mOpen, mTempDatabase, mInDeclarativePhase;
1030 #ifdef OOF_DEBUG_LOG_NAME
1031  static ofstream sDebugLog;
1032  static oofDirectory sDebugDir;
1033 #endif
1034 // friend dbTable::dbTable(const char*);
1035 // friend dbTable::dbTable(const dbTable& rhs);
1036 // friend class dbRelationship;
1037 };
1038 
1039 
1040 class dbBLOB;
1041 
1042 
1048 // uses lots of public methods but is only ever accessed by a dbTable or dbField subclass
1049 // so no problems
1050 protected:
1053  virtual ~OOF_tableBackend();
1054 
1055  public:
1056  virtual void addIndices(const char* newIDXname)=0;
1057  virtual void suppressIndices()=0;
1058  virtual void rebuild()=0;
1059  virtual void close()=0;
1060  virtual void deleteStorage();
1061  virtual void buildSchema(bool rebuilding=false)=0;
1062  virtual void createTableInConnection(const dbConnect*)=0;
1063  virtual bool openTableInConnection(const dbConnect*, const bool createIfMissing = false)=0;
1064 
1065  virtual void setFileExtensions(const char* dataExt, const char* indexExt)=0;
1066  virtual OOF_tableBackend* clone(dbTable::selSharingT, dbTable*) const=0;
1067  virtual void describeState(std::ostream&) const=0;
1068  virtual void describeInvariant(std::ostream&) const=0;
1069 
1070 
1072 
1073  virtual oidT currentOID()=0;
1074  virtual oidT oidOfRecord(unsigned long)=0;
1076 
1077 // recordwise access
1078  virtual void start()=0;
1079  virtual void next()=0;
1080  virtual void prev()=0;
1081  virtual bool more() const=0;
1082  virtual bool atFirst() const=0;
1083  virtual bool atLast() const=0;
1084  virtual bool atRelative(unsigned long) const=0;
1085  virtual unsigned long count() const=0;
1086  virtual unsigned long countAll() const=0;
1087 
1089 
1090  virtual void setSortOrder(dbSorter* adoptSorter)=0;
1091  virtual dbSorter* sorter() const=0;
1092  virtual void sortSelectionNow(fieldNumT)=0;
1093  virtual void sortSelectionInverseNow(fieldNumT)=0;
1094  virtual void sortSelectionNow(const dbSorter*)=0;
1096 
1098 
1099  virtual bool readBool(const dbField*) const=0;
1100  virtual short readShort(const dbField*) const=0;
1101  virtual long readLong(const dbField*) const=0;
1102  virtual double readDouble(const dbField*) const=0;
1103 
1108  virtual const char* readChars(const dbField*) const=0;
1109 
1113  virtual oofString readString(const dbField*) const=0;
1114 
1115  virtual void writeBool(bool, const dbField*)=0;
1116  virtual void writeShort(short, const dbField*)=0;
1117  virtual void writeLong(long, const dbField*)=0;
1118  virtual void writeDouble(double, const dbField*)=0;
1119  virtual void writeChars(const char*, long numChars, long maxLen, const dbField*, long startIndex=0)=0;
1120  virtual void writeBytes(const char* inBuf, long inLen, const dbField* inField)=0;
1121  virtual char* getByteWriteAddress(unsigned long, const dbField*)=0;
1123 
1124 
1126 
1127  virtual void newRecord()=0;
1128  virtual void deleteRecord()=0;
1129  virtual void saveRecord()=0;
1130  virtual void revertRecord()=0;
1131  virtual void unloadRecord()=0;
1132  virtual void unloadCache()=0;
1133  virtual bool reloadRecord()=0;
1134  virtual bool isRecordLoaded() const=0;
1135  virtual void setBlobLength(fieldNumT, unsigned long len)=0;
1136  virtual void loadBlob(const dbBLOB*)=0;
1137  bool isDirty() const;
1138  virtual bool isNewRecord() const=0;
1139  void markDirty();
1140  virtual void pack()=0;
1142 
1144 
1145  void fieldHasDefaultCalculator(dbField*);
1146  void fieldHasStoredCalculator(dbField*);
1147  virtual unsigned int numIndexes() const=0;
1148  virtual unsigned int numFiles() const=0;
1149  virtual unsigned long fieldDataLen(const dbField*) const=0;
1150  virtual unsigned long blobPointerReferenceSize() const=0;
1151  virtual unsigned long sequenceNumber() const=0;
1152  virtual bool allSelected() const=0;
1153  virtual bool fieldIsDirty(fieldNumT) const=0;
1154  dbTable* table() const;
1155  dbField* field(fieldNumT) const;
1156  virtual void ignoreDuplicateRecords()=0;
1157  virtual void noticeDuplicateRecords()=0;
1159 
1161 
1162  virtual unsigned long recordNumber() const=0;
1163  virtual unsigned long recordNumberOfOID(oidT inOID)=0;
1164  virtual bool gotoRecord(unsigned long relativeNum)=0;
1165  virtual void selectAll()=0;
1166  virtual void selectNone()=0;
1167  virtual bool search(const dbQueryClause*)=0;
1168  virtual unsigned long recordNumberMatching(const dbQueryClause* qClause, bool* outFoundIt=0) const=0;
1169  virtual bool checkDuplicate(const dbQueryClause*)=0;
1170  virtual bool searchSelection(const dbQueryClause*)=0;
1171  virtual bool searchEqual(const dbField*, const char*, bool matchEntireKey=true)=0;
1172  virtual bool searchEqual(const dbField*, const void*)=0;
1173  virtual bool searchSelContainsAnyDelimited(const dbField* schField, const char *schStr, char delim)=0;
1174  virtual bool searchSelContainsAnyOf(const dbField* schField, const char **schStrs, unsigned long count)=0;
1175 
1176  virtual bool searchSelContainsAllDelimited(const dbField* schField, const char *schStr, char delim)=0;
1177  virtual bool searchSelContainsAllOf(const dbField* schField, const char **schStrs, unsigned long count)=0;
1178  virtual bool loadRelatedContextJoiningFromTo(const dbField*, const dbField*)=0;
1179 
1180  virtual bool addOIDtoSelection(oidT)=0;
1181  virtual bool contains(oidT) const=0;
1182  virtual void dropRecordFromSelection(unsigned long)=0;
1183 
1184  virtual void invert()=0;
1185  virtual void difference_with(const OOF_tableBackend*)=0;
1186  virtual void intersection_with(const OOF_tableBackend*)=0;
1187  virtual void union_with(const OOF_tableBackend*)=0;
1188  virtual void union_with_no_overlap(const OOF_tableBackend*)=0;
1189  virtual void difference_with(const dbSelection&)=0;
1190  virtual void intersection_with(const dbSelection&)=0;
1191  virtual void union_with(const dbSelection&)=0;
1192  virtual void union_with_no_overlap(const dbSelection&)=0;
1194 
1196 
1197  virtual dbSelection currentSelection() const=0;
1198  virtual dbSelection makeEmptySelection() const=0;
1199  virtual void setSelection(const dbSelection&)=0;
1200  virtual void setSelection(const OOF_Selection*)=0;
1202 
1204 
1205  virtual bool selectJustOID(oidT)=0;
1206  virtual void selectJustCurrent()=0;
1208 
1210 
1211  virtual void lockRecord()=0;
1212  virtual void unlockRecord()=0;
1214 
1216 
1217  virtual void beginTransaction(short tMode = 0)=0;
1218  virtual void abortTransaction(short rMode = 0)=0;
1219  virtual void commitTransaction(short rMode = 0)=0;
1221 
1222  //debugging
1223 #ifdef OOF_DebugDumpBlobState
1224  virtual void describeBlobs()=0;
1225 #endif
1226 
1227  protected:
1228  virtual void CachingContextChange()=0;
1229  virtual void ContextChange()=0;
1230  bool tableCachesDirtyRecords() const;
1231 
1232  // data storage
1233  OOF_Dictionary mFields; // copy of dbTable handle object, one representation
1235  bool mDirty;
1236  bool mHasDefaultCalculators, mHasStoredCalculators;
1237 
1238  friend class dbTable;
1239 };
1240 
1241 
1242 class OOF_Segment;
1248 public:
1249 // constructors
1252  virtual ~OOF_FieldSegOwner() {};
1253 
1254 
1255  virtual unsigned short countSegments() const;
1256  virtual void addSegment(dbField&);
1259  void toggleSegmentReversedFlags();
1260 
1261 // reflective operators
1262  OOF_Segment* segment(unsigned int) const;
1263  fieldNumT fieldNumberOfSegment(unsigned int) const;
1264 
1265 // data storage
1266 private:
1267  OOF_Dictionary mSegments;
1268 };
1269 
1270 
1278 public:
1279  dbSorter();
1280  dbSorter(const dbSorter&);
1281  dbSorter(const OOF_FieldSegOwner&);
1282  virtual ~dbSorter() {};
1283  virtual void describe(std::ostream&) const;
1284 
1287 
1288 
1289  void setSortOnSaves(bool willSortOnSaves=true);
1290 
1291  void suspendSorting();
1292  void resumeSorting();
1293  bool sortingSuspended() const;
1294 
1295 // must implement the following in concrete classes
1296  virtual dbSorter* clone() const;
1297  virtual void sortNow(OOF_tableBackend*);
1298  virtual unsigned short sortFieldNo() const;
1299  virtual bool sortsBySingleField() const;
1300  bool operator!=(const dbSorter* rhs) const;
1301 
1302 // state changers
1303  void backendSavedRecord(OOF_tableBackend*);
1304  void backendChangedContext(OOF_tableBackend*);
1305  void selectionChanged();
1306 
1307 // state getter
1308  virtual unsigned long state() const;
1309 
1310 protected:
1311 // data storage
1312  bool mSortOnSaves, mNeedsToSort, mSorting, mSuspended;
1313 };
1314 
1315 
1322 public:
1323  reversed(dbField& fld) : mField(fld) {};
1324  reversed(dbField* fld) : mField(*fld) {};
1325 // use default copy ctor
1326 
1327  dbField& Field() const { return mField; }
1328 
1329 private:
1330  dbField& mField;
1331 };
1332 
1333 // try including these definitions here anyway as complaints from VC6 about above friends
1336 
1337 
1345 public:
1346  dbFieldSorter(fieldNumT, bool shouldReverse=false);
1347 private:
1348  dbFieldSorter(const dbFieldSorter&) { assert(0); } //lint !e1538 missing members in init list
1349 public:
1350  virtual ~dbFieldSorter() {};
1351 
1352  virtual void describe(std::ostream&) const;
1353 
1354  virtual dbSorter* clone() const;
1355  virtual void sortNow(OOF_tableBackend*);
1356  virtual unsigned short sortFieldNo() const;
1357  bool sortsInReverse() const;
1358  virtual bool sortsBySingleField() const;
1359  void changeSortFieldTo(fieldNumT, bool shouldReverse=false);
1360 
1361 protected:
1362 // data storage
1363  fieldNumT mSortFieldNo;
1365 };
1366 
1367 
1373 public:
1375  ~stSuspendSort();
1376 
1377 private:
1378  dbTable* mTable;
1379 };
1380 
1381 
1387 public:
1389  virtual ~stSaveSelectionAndSuspendSort();
1390 };
1391 
1392 
1393 #ifdef OOF_USING_EXCEPTIONS
1394 
1399  public:
1400  stLockRecord(dbTable* inTable);
1401  stLockRecord(dbTable& inTable);
1402  ~stLockRecord();
1403 
1404  private:
1405  void InitLock();
1406  dbTable* mTable;
1407  };
1408 #endif
1409 
1410 
1411 #ifndef OOF_DISALLOW_CHANGE_SHIELDING
1412 
1418  public:
1419  stChangeShielded(dbTable* inTable);
1420  stChangeShielded(dbTable& inTable);
1421  ~stChangeShielded();
1422 
1423  private:
1424  dbTable* mTable;
1425  };
1426 #endif
1427 
1428 
1434 public:
1435  dbCloneCleanup(dbTable* listensTo);
1436 // use default copy ctor
1437  virtual ~dbCloneCleanup();
1438 
1439  virtual bool receiveMsg(OOFmsgT msg, unsigned long senderDefined);
1440 
1441 // data storage
1442 private:
1443  dbTable* mTable;
1444 };
1445 
1446 
1447 class OOF_RelMN; // forward
1448 
1457 public:
1458  dbRelMaintainer(dbRelRefBase* relToRHS, OOF_RelMN* linkWeAlert);
1459 // use default copy ctor
1460  virtual ~dbRelMaintainer();
1461 
1462  virtual bool receiveMsg(OOFmsgT msg, unsigned long senderDefined);
1463 
1464 // data storage
1465 private:
1466  OOF_RelMN* mLink;
1467 };
1468 
1469 
1470 // utility functions
1471 bool skipTillDigit(std::istream&, char fieldSep=dbTable::kFieldSep, char recSep=dbTable::kRecSep);
1472 bool skipRestOfField(std::istream&, char fieldSep=dbTable::kFieldSep, char recSep=dbTable::kRecSep);
1473 bool skipTillNumber(std::istream& is, char fieldSep, char recSep, bool canStartWithDecimal=false);
1474 
1475 
1476 // -------------------------------------------------------
1477 // O O F _ D i c t r e p
1478 // -------------------------------------------------------
1479 inline
1480 OOF_bitPointer& OOF_DictRep::item(unsigned int index)
1481 {
1482  return operator[](index);
1483 }
1484 
1485 
1486 // -------------------------------------------------------
1487 // O O F _ D i c t i o n a r y
1488 // -------------------------------------------------------
1489 
1490 inline unsigned int
1492 {
1493  return mInternalIter;
1494 }
1495 
1496 
1497 inline unsigned int
1499 {
1500  return mRep->mNextFreeEntry;
1501 }
1502 
1503 
1504 inline void
1506 {
1507  mInternalIter = 0;
1508 }
1509 
1510 
1511 inline bool
1513 {
1514  return mInternalIter < mRep->mNextFreeEntry;
1515 }
1516 
1517 
1518 inline void
1520 {
1521  mInternalIter++;
1522 }
1523 
1524 
1525 inline bool
1526 OOF_Dictionary::EntryMatchesVisibility(const OOF_PublicBase* entry, bool wantVisible) const
1527 {
1528  assert(entry);
1529  bool isVisible = !entry->hidden();
1530  return ((isVisible && wantVisible) || (!isVisible && !wantVisible));
1531 }
1532 
1533 
1534 inline void
1536 {
1537  start();
1538  moreVisible(wantVisible); //lint !e534 ignore return value - safe as start doesn't guarantee item
1539 }
1540 
1541 
1542 inline void
1544 {
1545  next();
1546  moreVisible(wantVisible); //lint !e534 ignore return value - safe as start doesn't guarantee item
1547 }
1548 
1549 
1550 inline void
1552 {
1553  mRep->Append(aBit);
1554 }
1555 
1556 
1557 inline OOF_bitPointer
1559 {
1560  return mRep->Pop();
1561 }
1562 
1563 
1564 inline void
1566 {
1567  mRep->Reset();
1568 }
1569 
1570 
1571 inline OOF_bitPointer&
1572 OOF_Dictionary::operator()() // current value
1573 {
1574  return mRep->operator[](mInternalIter);
1575 }
1576 
1577 /*
1578 inline OOF_bitPointer&
1579 OOF_Dictionary::operator[](int index)
1580 {
1581  assert(index>=0);
1582  return mRep->item(index);
1583 }
1584 */
1585 
1586 inline OOF_bitPointer&
1587 OOF_Dictionary::item(unsigned int index)
1588 {
1589  return mRep->item(index);
1590 }
1591 
1592 
1593 inline OOF_bitPointer
1594 OOF_Dictionary::value(unsigned int index) const
1595 {
1596  return mRep->value(index);
1597 }
1598 
1599 
1600 inline OOF_bitPointer&
1602 {
1603  return mRep->operator[](name);
1604 }
1605 
1606 
1607 inline OOF_bitPointer&
1608 OOF_Dictionary::operator[](unsigned int index)
1609 {
1610  return mRep->operator[](index);
1611 }
1612 
1613 
1614 inline OOF_bitPointer&
1615 OOF_Dictionary::lookupByAttribute(const char* attributeValue, const char* attributeType)
1616 {
1617  return mRep->lookupByAttribute(attributeValue, attributeType);
1618 }
1619 
1620 
1621 inline OOF_bitPointer&
1623 {
1624  return sMissingItem;
1625 }
1626 
1627 
1628 
1629 // -------------------------------------------------------
1630 // d b C o n n e c t
1631 // -------------------------------------------------------
1632 inline dbConnect*
1634 {
1635  return sCurrentlyConstructing;
1636 }
1637 
1638 
1639 inline const oofString&
1641 {
1642  return mConnectionName;
1643 }
1644 
1645 inline unsigned int
1647 {
1648  return mTables.count();
1649 }
1650 
1651 
1652 inline bool
1654 {
1655  return sCurrentlyConstructing!=0;
1656 }
1657 
1658 
1659 inline void
1661 {
1662  sTruncateTrailingSpaces = willTruncate;
1663 }
1664 
1665 
1666 inline bool
1668 {
1669  return sTruncateTrailingSpaces;
1670 }
1671 
1672 
1673 #ifdef OOF_DEBUG_LOG_NAME
1674 inline std::ostream&
1675 dbConnect::debugLog()
1676 {
1677  return sDebugLog;
1678 }
1679 #endif
1680 
1681 
1682 inline oofDirectory*
1684 {
1685  return mDatabaseDir;
1686 }
1687 
1688 
1689 inline bool
1691 {
1692  return mOpen;
1693 }
1694 
1695 
1701 inline bool
1703 {
1704  return sCurrentlyConstructing == this;
1705 }
1706 
1707 
1708 // -------------------------------------------------------
1709 // O O F _ t a b l e B a c k e n d
1710 // -------------------------------------------------------
1711 inline void
1713 {
1714  mDirty=true;
1715 }
1716 
1717 
1718 inline bool
1720 {
1721  return mDirty;
1722 }
1723 
1724 
1725 inline dbTable*
1727 {
1728  return mTable;
1729 }
1730 
1731 
1732 inline dbField*
1733 OOF_tableBackend::field(fieldNumT fieldNum) const
1734 {
1735  return (dbField *) mFields.value(fieldNum); // safe downcast
1736 }
1737 
1738 
1739 inline void
1741 {
1742  mHasDefaultCalculators = true;
1743 }
1744 
1745 
1746 inline void
1748 {
1749  mHasStoredCalculators = true;
1750 }
1751 
1752 
1753 // -------------------------------------------------------
1754 // d b T a b l e A s s i g n e r
1755 // -------------------------------------------------------
1756 inline dbTableAssigner&
1757 dbTableAssigner::operator<<(const char* inString)
1758 {
1759  setNextFieldString(inString);
1760  return *this;
1761 }
1762 
1763 
1764 
1765 // -------------------------------------------------------
1766 // d b T a b l e
1767 // -------------------------------------------------------
1768 #if 0
1769 inline dbTable::operator dbTable*()
1770 {
1771  return this;
1772 };
1773 #endif
1774 
1775 inline bool
1777 {
1778  return (mTableValid!=eClosed);
1779 }
1780 
1781 
1786 inline bool
1788 {
1789  return (!mConnection || mConnection->inDeclarativePhase());
1790 }
1791 
1792 
1793 
1794 inline bool
1796 {
1797  return (mTableValid==eValid);
1798 }
1799 
1800 
1801 inline dbTable::tableValidT
1803 {
1804  return mTableValid;
1805 }
1806 
1807 
1808 inline int
1810 {
1811  return mValidatingDepth;
1812 }
1813 
1814 
1815 inline dbRelRefBase*
1817 {
1818  return mRelToLHS;
1819 }
1820 
1821 
1822 inline bool
1824 {
1825  return mBackend->isRecordLoaded();
1826 }
1827 
1828 
1829 inline void
1831 {
1832  mBackend->noticeDuplicateRecords();
1833 }
1834 
1835 
1836 inline void
1838 {
1839  mBackend->ignoreDuplicateRecords();
1840 }
1841 
1842 inline unsigned long
1844 {
1845  return mBackend->sequenceNumber();
1846 }
1847 
1848 
1849 inline unsigned int
1851 {
1852  return mBackend->numIndexes();
1853 }
1854 
1855 
1856 inline unsigned int
1858 {
1859  return mBackend->numFiles();
1860 }
1861 
1862 
1863 inline fieldNumT
1865 {
1866  return mFieldCount;
1867 }
1868 
1869 
1874 inline void
1875 dbTable::setTableValid(bool validState)
1876 {
1877 #ifdef OOF_DEBUG_LOG_NAME
1878  if (validState)
1879  StandardDebugLog("dbTable::setTableValid(true)");
1880  else
1881  StandardDebugLog("dbTable::setTableValid(false)");
1882 #endif
1883 
1884  if (validState)
1885  mTableValid = eValid;
1886  else
1887  mTableValid = eInvalid;
1888  // can't set closed state - side-effect of close()
1889 }
1890 
1891 
1895 inline bool
1897 {
1898  return mBackend->more();
1899 }
1900 
1901 
1905 inline bool
1907 {
1908  return mBackend->allSelected();
1909 }
1910 
1911 
1912 inline bool
1914 {
1915  return mBackend->atFirst();
1916 }
1917 
1918 
1919 inline bool
1921 {
1922  return mBackend->atLast();
1923 }
1924 
1925 
1926 inline bool
1927 dbTable::atRelative(unsigned long rel) const
1928 {
1929  return mBackend->atRelative(rel);
1930 }
1931 
1932 
1937 inline oidT
1939 {
1940  if (!isTableValid())
1941  MakeTableValid();
1942  return mBackend->currentOID();
1943 }
1944 
1945 
1950 inline bool
1952 {
1953  if (!isTableValid())
1954  MakeTableValid();
1955  return mBackend->contains(inOID);
1956 }
1957 
1958 
1959 inline oidT
1960 dbTable::oidOfRecord(unsigned long recno)
1961 {
1962  return mBackend->oidOfRecord(recno);
1963 }
1964 
1965 
1969 inline void
1971 {
1972 #ifdef OOF_DEBUG_LOG_NAME
1973  StandardDebugLog("dbTable::next()");
1974 #endif
1975 
1976  ContextChange();
1977  mBackend->next();
1978 }
1979 
1980 
1985 inline void
1987 {
1988  ContextChange();
1989  mBackend->gotoRecord(0); //lint !e534 ignore return value - OK as first doesn't guarantee have current record
1990 }
1991 
1992 
1996 inline void
1998 {
1999  ContextChange();
2000  mBackend->prev();
2001 }
2002 
2003 
2004 inline void
2006 {
2007  if (!isTableValid())
2008  MakeTableValid();
2009 }
2010 
2011 
2016 inline unsigned long
2018 {
2019  if (!isTableValid())
2020  MakeTableValid();
2021  return mBackend->count();
2022 }
2023 
2024 
2028 inline unsigned long
2030 {
2031  return mBackend->countAll();
2032 }
2033 
2034 
2040 inline unsigned long
2042 {
2043  if (isRecordLoaded())
2044  return mBackend->recordNumber();
2045  else
2046  return 0;
2047 }
2048 
2049 
2055 inline unsigned long
2057 {
2058  return mBackend->recordNumberOfOID(inOID);
2059 }
2060 
2061 
2062 inline unsigned long
2063 dbTable::recordNumber(const dbQueryClause* qClause, bool* outFoundIt) const
2064 {
2065  return mBackend->recordNumberMatching(qClause, outFoundIt);
2066 }
2067 
2068 
2069 inline unsigned long
2070 dbTable::recordNumber(const dbQueryClause& qClause, bool* outFoundIt) const
2071 {
2072  return mBackend->recordNumberMatching(&qClause, outFoundIt);
2073 }
2074 
2075 
2076 inline void
2078 {
2079  difference_with(*rhs);
2080 }
2081 
2082 
2086 inline void
2088 {
2089  difference_with(*rhs);
2090 }
2091 
2092 
2096 inline void
2098 {
2099  difference_with(rhs);
2100 }
2101 
2102 
2106 inline void
2108 {
2109  difference_with(rhs);
2110 }
2111 
2112 
2116 inline void
2118 {
2119  difference_with(rhs);
2120 }
2121 
2122 
2126 inline void
2128 {
2129  difference_with(rhs);
2130 }
2131 
2132 
2136 inline void
2138 {
2139  difference_with(*rhs);
2140 }
2141 
2142 
2143 inline void
2145 {
2146  intersection_with(*rhs);
2147 }
2148 
2149 
2153 inline void
2155 {
2156  intersection_with(rhs);
2157 }
2158 
2159 
2163 inline void
2165 {
2166  intersection_with(rhs);
2167 }
2168 
2169 
2173 inline void
2175 {
2176  intersection_with(*rhs);
2177 }
2178 
2179 
2183 inline void
2185 {
2186  invert();
2187 }
2188 
2189 
2193 inline void
2195 {
2196  invert();
2197 }
2198 
2199 
2200 inline void
2202 {
2203  union_with(*rhs);
2204 }
2205 
2206 
2207 inline void
2209 {
2210  union_with_no_overlap(*rhs);
2211 }
2212 
2213 
2217 inline void
2219 {
2220  union_with(rhs);
2221 }
2222 
2223 
2227 inline void
2229 {
2230  union_with(rhs);
2231 }
2232 
2233 
2237 inline void
2239 {
2240  union_with(*rhs);
2241 }
2242 
2243 
2247 inline void
2249 {
2250  union_with(*rhs);
2251 }
2252 
2253 
2257 inline void
2259 {
2260  union_with(rhs);
2261 }
2262 
2263 
2267 inline void
2269 {
2270  union_with(rhs);
2271 }
2272 
2273 
2277 inline bool
2279 {
2280  return addOIDtoSelection(rhs);
2281 }
2282 
2283 
2291 inline dbTableAssigner
2292 dbTable::operator<<(const char* inString)
2293 {
2294  return dbTableAssigner(this, inString);
2295 }
2296 
2297 
2303 inline void
2305 {
2306 #ifdef OOF_DEBUG_LOG_NAME
2307  StandardDebugLog("dbTable::selectAll()");
2308 #endif
2309 
2310  mBackend->selectAll();
2311  broadcast(OOFmsg_ChangeSelection);
2312 }
2313 
2314 
2320 inline void
2322 {
2323 #ifdef OOF_DEBUG_LOG_NAME
2324  StandardDebugLog("dbTable::selectNone()");
2325 #endif
2326 
2327  mBackend->selectNone();
2328  unloadRecord();
2329  broadcast(OOFmsg_ChangeSelection);
2330 }
2331 
2332 
2333 inline bool
2335 {
2336  return mBackend->isDirty();
2337 }
2338 
2339 
2340 inline bool
2342 {
2343  return mBackend->isNewRecord();
2344 }
2345 
2346 
2347 inline bool
2349 {
2350  return (mRelToLHS!=0);
2351 }
2352 
2353 
2354 inline dbField*
2355 dbTable::field(fieldNumT fieldNum) const
2356 {
2357  return (dbField *) mFields.value(fieldNum); // safe downcast
2358 }
2359 
2360 
2361 inline dbField*
2362 dbTable::field(const oofString& fieldName)
2363 {
2364  return (dbField *) mFields[fieldName];
2365 }
2366 
2367 
2368 inline const oofString&
2370 {
2371  return mTableName;
2372 }
2373 
2374 
2375 inline tableNumT
2377 {
2378  return mTableNumber;
2379 }
2380 
2381 
2382 inline bool
2384 {
2385  bool ret = (
2386  (mSaveOption == dbTable::requireExplicitAndBuffer) ||
2387  (mSaveOption == dbTable::bufferForever) )
2388  ;
2389  return ret;
2390 }
2391 
2392 
2393 inline dbTable::saveOptionsT
2395 {
2396  return mSaveOption;
2397 }
2398 
2399 
2400 inline void
2401 dbTable::setName(const char* inName)
2402 {
2403  mTableName = inName;
2404 }
2405 
2406 
2407 inline void
2408 dbTable::setFileExtensions(const char* dataExt, const char* indexExt)
2409 {
2410  mBackend->setFileExtensions(dataExt, indexExt);
2411 }
2412 
2413 
2414 inline dbSorter*
2416 {
2417  return mBackend->sorter();
2418 }
2419 
2420 
2421 
2426 inline void
2428 {
2429 #ifdef OOF_DEBUG_LOG_NAME
2430  StandardDebugLog("dbTable::selectJustCurrent()");
2431 #endif
2432  mBackend->selectJustCurrent();
2433  broadcast(OOFmsg_ChangeSelection);
2434 }
2435 
2436 
2437 inline void
2439 {
2440  if (!mLockedCurrentRecord)
2441  mBackend->lockRecord(); // may throw OOFE_LockedRecord if already locked
2442  mLockedCurrentRecord = true;
2443 }
2444 
2445 
2446 inline void
2448 {
2449  if (mLockedCurrentRecord)
2450  mBackend->unlockRecord();
2451  mLockedCurrentRecord =false;
2452 }
2453 
2454 
2455 inline bool
2457 {
2458  return mTransactionDirty;
2459 }
2460 
2461 
2462 inline void
2464 {
2465  mBackend->pack();
2466 }
2467 
2468 
2469 inline bool
2471 {
2472  return mLockedCurrentRecord;
2473 }
2474 
2475 
2476 inline dbTable*
2478 {
2479  return mPrototype;
2480 }
2481 
2482 
2483 
2484 #ifndef OOF_DISALLOW_CHANGE_SHIELDING
2485 
2491 inline bool
2493 {
2494  return mChangeShielded;
2495 }
2496 
2497 
2498 inline void
2499 dbTable::changeShielded(bool setShielding)
2500 {
2501  mChangeShielded = setShielding;
2502 }
2503 #endif
2504 
2505 
2506 inline
2507 void dbTable::describeInvariant(std::ostream& os) const
2508 {
2509  mBackend->describeInvariant(os);
2510 }
2511 
2512 // -------------------------------------------------------
2513 // O O F _ t a b l e B a c k e n d
2514 // -------------------------------------------------------
2515 // just the methods that have to be after dbTable inlines above
2516 
2517 inline bool
2519 {
2520  const bool ret = mTable->tableCachesDirtyRecords();
2521  return ret;
2522 }
2523 
2524 
2525 
2526 // -------------------------------------------------------
2527 // d b S o r t e r
2528 // -------------------------------------------------------
2529 inline bool
2531 {
2532  return mSuspended;
2533 }
2534 
2535 
2536 inline void
2538 {
2539  mSortOnSaves = onSaves;
2540 }
2541 
2542 
2543 inline dbSorter&
2545 {
2546  addSegment(segField);
2547  return *this;
2548 }
2549 
2550 
2551 
2552 
2553 // -------------------------------------------------------
2554 // O O F _ D i c t i o n a r y
2555 // -------------------------------------------------------
2556 inline void
2558 {
2559  mOwnsContents = ownsFlag;
2560 }
2561 
2562 
2563 // -------------------------------------------------------
2564 // d b F i e l d S o r t e r
2565 // -------------------------------------------------------
2566 inline bool
2568 {
2569  return mReverseSort;
2570 }
2571 
2572 
2573 // -------------------------------------------------------
2574 // O O F _ F i e l d S e g O w n e r
2575 // -------------------------------------------------------
2576 inline unsigned short
2578 {
2579  return mSegments.count();
2580 }
2581 
2582 
2583 inline OOF_FieldSegOwner&
2585 {
2586  addSegment(segField);
2587  return *this;
2588 }
2589 
2590 
2591 inline OOF_Segment*
2592 OOF_FieldSegOwner::segment(unsigned int i) const
2593 {
2594  assert(i<mSegments.count());
2595  return (OOF_Segment*)(mSegments.value(i)); // safe downcast
2596 }
2597 
2598 
2599 
2600 // -------------------------------------------------------
2601 // o o f R u n t i m e E n v
2602 // -------------------------------------------------------
2603 
2604 inline bool
2606  {
2607  #ifdef _Macintosh
2608  return true;
2609  #else
2610  return false;
2611  #endif
2612  }
2613 
2614 
2615 inline bool
2617  {
2618  #ifdef _Windows
2619  return true;
2620  #else
2621  return false;
2622  #endif
2623  }
2624 
2625 
2626 inline bool
2628  {
2629  #ifdef _Unix
2630  return true;
2631  #else
2632  return false;
2633  #endif
2634  }
2635 
2636 
2637 inline const char*
2639 {
2640 #ifdef _Macintosh
2641  return "alias";
2642 #elif defined _Windows
2643  return "shortcut";
2644 #elif defined _Unix
2645  return "link";
2646 #else
2647 error platform unknown
2648 #endif
2649 }
2650 
2651 
2652 inline void
2654 {
2655 #ifdef _Macintosh
2656  #ifndef _Macintosh_Mach // really Unix - don't need to spend background time
2657  EventRecord ev;
2658  ::WaitNextEvent(everyEvent, &ev, 0x0, NULL);
2659  #endif
2660 #elif defined _Windows
2661 // NOT YET IMPLEMENTED - only needed for older Windows
2662 #elif defined _Unix
2663 // don't need to spend background time
2664 #else
2665 error platform unknown
2666 #endif
2667 }
2668 
2669 // -------------------------------------------------------
2670 // O O F _ m i x R e f C o u n t
2671 // -------------------------------------------------------
2672 inline OOF_mixRefCount::OOF_mixRefCount(unsigned long initialRefs) :
2673  mReferences(initialRefs)
2674 {}
2675 
2676 inline void
2678 {
2679  ++mReferences;
2680 }
2681 
2682 // -------------------------------------------------------
2683 // O O F _ m i x R e f C o u n t W i t h C o p y
2684 // -------------------------------------------------------
2686  mSharedReferences(rhs.mSharedReferences), //lint !e1554 direct pointer copy is OK
2687  mTimesDecCalled(0)
2688 {
2689  incRefs();
2690 }
2691 
2692 inline void
2694 {
2695  ++(*mSharedReferences);
2696 }
2697 
2698 
2699 
2700 
2701 #endif //H_OOF1
2702 
void setFileExtensions(const char *dataExt, const char *indexExt)
Definition: oof1.h:2408
oofDirectory * mDatabaseDir
Definition: oof1.h:1025
messaging layer of OOFILE application development framework.
connectionFileStateT
Definition: oof1.h:1000
bool inDeclarativePhase() const
Has database been opened or are we still potentially declaring tables.
Definition: oof1.h:1787
Mixin for classes allowing you to declare segments based on fields.
Definition: oof1.h:1247
dbTable * mTable
Definition: oof1.h:399
Save and restore state of ignoring duplicates.
Definition: oof1.h:409
saveOptionsT
Definition: oof1.h:464
virtual ~dbSorter()
Definition: oof1.h:1282
bool allSelected() const
Does the current selection represent all records or just a subset.
Definition: oof1.h:1906
OOF_PublicBase(const OOF_PublicBase &rhs)
Definition: oof1.h:61
Database backend for a single RAM-resident table.
Definition: oofram.h:26
Definition: oof1.h:236
void start()
Definition: oof1.h:1505
OOF_PublicBase()
Definition: oof1.h:60
virtual ~dbFieldSorter()
Definition: oof1.h:1350
unsigned long count()
Count records in current selection.
Definition: oof1.h:2017
oofString mTableName
Definition: oof1.h:790
simple specification class used to declare sort orders.
Definition: oof1.h:1321
Reporter that formats output for HTML responses.
Definition: oof1.h:878
bool atRelative(unsigned long) const
Definition: oof1.h:1927
Abstract manager coordinating dbHelper objects that manage interaction on a window.
Definition: oofgui.h:301
tableNumT tableNumber() const
Definition: oof1.h:2376
fieldNumT mNextFieldNum
Definition: oof1.h:442
void selectJustCurrent()
Change the current selection to just the current record.
Definition: oof1.h:2427
unsigned long recordNumber() const
Ordinal record number of current record in selection.
Definition: oof1.h:2041
bool hidden() const
Definition: oof1.h:51
void reset()
Definition: oof1.h:1565
Tries to hide the different platforms and version issues with standard IO.
Declare macros used by most of OOFILE.
Base class for user-replaceable word parser.
Definition: oofwords.h:40
OOF_bitPointer & lookupByAttribute(const char *attributeValue, const char *attributeType=0)
Definition: oof1.h:1615
void noticeDuplicateRecords()
Definition: oof1.h:1830
static bool sCloning
Definition: oof1.h:841
static bool willTruncateTrailingSpaces()
Definition: oof1.h:1667
virtual unsigned short countSegments() const
Definition: oof1.h:2577
static void truncateTrailingSpaces(bool willTruncate=true)
Definition: oof1.h:1660
Highest level used to assemble queries.
Definition: oofquery.h:46
const OOFmsgT OOFmsg_ChangeSelection
Definition: oofmsg.h:33
bool isDirty() const
Definition: oof1.h:1719
tableValidT
Definition: oof1.h:465
bool skipRestOfField(std::istream &, char fieldSep=dbTable::kFieldSep, char recSep=dbTable::kRecSep)
OOF_bitPointer & item(unsigned int index)
Definition: oof1.h:1587
Envelope class to contain an abstract selection apart from its dbTable.
Definition: oof1.h:316
abstract base for public interface to selections.
Definition: oof2.h:107
fieldNumT mFieldCount
Definition: oof1.h:792
static bool isWindows()
Definition: oof1.h:2616
virtual ~OOF_FieldSegOwner()
Definition: oof1.h:1252
void operator+=(dbTable &)
Operator performing union_with set operation.
Definition: oof1.h:2218
Special limited oofReceiver which will only ever listen to one oofBroadcaster at a time...
Definition: oofmsg.h:133
virtual bool receiveMsg(OOFmsgT msg, unsigned long senderDefined)
The default receiveMsg behaviour is to delete yourself when the broadcaster closes.
Definition: oofmsg.cpp:275
OOF_FieldSegOwner & operator<<(dbField &)
Definition: oof1.h:2584
bool mTempDatabase
Definition: oof1.h:1023
static dbTable * sCurrentlyConstructing
Definition: oof1.h:816
void append(OOF_bitPointer)
Definition: oof1.h:1551
oofRuntimeEnvT
Definition: oof1.h:902
unsigned int iter() const
Definition: oof1.h:1491
unsigned int numTables() const
Definition: oof1.h:1646
dbField * field(fieldNumT) const
Definition: oof1.h:1733
oidT oidOfRecord(unsigned long)
Definition: oof1.h:1960
dbTable * prototype() const
Definition: oof1.h:2477
fieldNumT mSortFieldNo
Definition: oof1.h:1363
Base exception for database table operations.
Definition: oofexcep.h:144
OOF_tableBackend * mBackend
Definition: oof1.h:788
dbField & Field() const
Definition: oof1.h:1327
dbTableAssigner operator<<(const char *)
Create dbTableAssigner as fast way to create and set entire record.
Definition: oof1.h:2292
abstract base for handling record contexts
Definition: oof2.h:37
dbSorter & operator<<(dbField &)
Definition: oof1.h:2544
virtual bool sortsBySingleField() const
Definition: oof1.cpp:3048
static bool sTruncateTrailingSpaces
Definition: oof1.h:1027
void operator%=(dbTable &)
Operator performing difference_with set operation.
Definition: oof1.h:2127
OOF_bitPointer value(unsigned int index) const
Definition: oof1.h:1594
Mixin for reference counted classes which you want to auto-delete when their count falls to zero...
Definition: oof1.h:82
Stack class to enable Change Shielding, so listeners not informed database changed.
Definition: oof1.h:1417
unsigned long countAll() const
Count records in database regardless of current selection.
Definition: oof1.h:2029
bool skipTillNumber(std::istream &is, char fieldSep, char recSep, bool canStartWithDecimal=false)
dbTable * mTable
Definition: oof1.h:416
bool contains(oidT)
Check if current selection contains an OID.
Definition: oof1.h:1951
bool more() const
When iterating a selection, are there any more records beyond current.
Definition: oof1.h:1896
static bool sCloningInDifferentConnection
Definition: oof1.h:842
void setName(const char *)
Definition: oof1.h:2401
static bool isUnix()
Definition: oof1.h:2627
Stack class to temporarily lock a record.
Definition: oof1.h:1398
void operator|=(dbTable &)
Operator performing union_with set operation.
Definition: oof1.h:2258
void selectAll()
Change the current selection to all records.
Definition: oof1.h:2304
Created by dbRelationship::linkMNvia to maintain an MN relationship.
Definition: oofrel.h:181
Mixin proving shared counter with cleanup and copying logic.
Definition: oof1.h:101
void ignoreDuplicateRecords()
Definition: oof1.h:1837
bool lockedCurrentRecord() const
Definition: oof1.h:2470
void fieldHasDefaultCalculator(dbField *)
Definition: oof1.h:1740
Parent for any field that is a relationship to another table.
Definition: oofrel.h:19
bool isRelatedClone() const
Definition: oof1.h:2348
bool isTableValid() const
Definition: oof1.h:1795
tableValidT mTableValid
Definition: oof1.h:795
Base class used mainly when exceptions not available.
Definition: oof1.h:852
Provide an iterable set of fields.
Definition: oofview.h:26
bool isDirty() const
Definition: oof1.h:2334
void nextVisible(bool wantVisible=true)
Definition: oof1.h:1543
unsigned int numFiles() const
Definition: oof1.h:1857
static dbConnect * sCurrentlyConstructing
this static gets zeroed in dbTable::postCloneTableCleanup() this is how we avoid passing dbTable poin...
Definition: oof1.h:1026
OOF_PublicBase * OOF_bitPointer
Base class typedef to make dictionaries easier to declare.
Definition: oof1.h:70
void operator-=(dbTable &)
Operator performing difference_with set operation.
Definition: oof1.h:2097
OOFILE_EXPORT std::istream & operator>>(std::istream &is, dbTable *tbl)
unsigned short tableNumT
Definition: oof1.h:275
bool atFirst() const
Definition: oof1.h:1913
OOF_mixRefCountWithCopy(unsigned long initialRefs=1)
Definition: oof1.cpp:3226
static bool isMacintosh()
Definition: oof1.h:2605
dbRelRefBase * controllingRelationship() const
Definition: oof1.h:1816
unsigned long oidT
type we pass around pretending we have a real OID.
Definition: oof1.h:229
bool changeShielded() const
change shielding, so field changes don't mark the record as dirty.
Definition: oof1.h:2492
Abstract interface to database backend.
Definition: oof1.h:1047
void selectNone()
Change the current selection to no records.
Definition: oof1.h:2321
void setSortOnSaves(bool willSortOnSaves=true)
Definition: oof1.h:2537
void prev()
Previous record in the selection becomes current.
Definition: oof1.h:1997
unsigned int mTimesDecCalled
Definition: oof1.h:113
tableNumT mTableNumber
Definition: oof1.h:791
unsigned int mReferences
Definition: oof1.h:90
dbTable * table() const
Definition: oof1.h:1726
Base class for exception hierarchy.
Definition: oofexcep.h:45
bool sortingSuspended() const
Definition: oof1.h:2530
void operator~()
Operator performing invert set operation.
Definition: oof1.h:2194
void lockRecord()
Definition: oof1.h:2438
const oofString & tableName() const
Definition: oof1.h:2369
Specify sort order by one more fields.
Definition: oof1.h:1277
static void spendBackgroundTime()
Definition: oof1.h:2653
bool mReverseSort
Definition: oof1.h:1364
OOF_DictRep * mRep
Definition: oof1.h:213
Helper class for dbTable to easily assign field values; Provides idiom of People << "Andy" << "Dent" ...
Definition: oof1.h:432
void describeInvariant(std::ostream &os) const
Definition: oof1.h:2507
Base class used to refer to main OOFILE classes and provide base reflective API.
Definition: oof1.h:49
bool sortsInReverse() const
Definition: oof1.h:2567
static const char * termForLink()
Definition: oof1.h:2638
bool isOpen() const
Definition: oof1.h:1690
saveOptionsT mSaveOption
Definition: oof1.h:793
static bool underConstruction()
Definition: oof1.h:1653
bool tableCachesDirtyRecords() const
Definition: oof1.h:2518
bool isOpen() const
Definition: oof1.h:1776
Array of longs which expands automatically as you write to cells.
Definition: oofarray.h:21
static oofString sSchemaFileExt
Definition: oof1.h:1029
Save & restore current database selection on the stack.
Definition: oof1.h:392
OOF_Segment * segment(unsigned int) const
Definition: oof1.h:2592
void first()
First record in the selection becomes current.
Definition: oof1.h:1986
dbField * field(fieldNumT) const
Definition: oof1.h:2355
void difference_with(const dbSelection &)
Definition: oof2.cpp:718
void extract(std::ostream &os)
Definition: oof1.h:967
unsigned int count() const
Definition: oof1.h:1498
virtual oofString name() const
Definition: oof1.cpp:349
unsigned short fieldNumT
Definition: oof1.h:276
dbSorter subclass used when sorting by a single field.
Definition: oof1.h:1344
Base class for persistent tables.
Definition: oof1.h:452
void hide(bool hideIt=true)
Definition: oof1.h:52
void next()
Next record in the selection becomes current.
Definition: oof1.h:1970
reversed(dbField *fld)
Definition: oof1.h:1324
Portable highly capable string class.
Definition: oofstr.h:101
virtual void describe(std::ostream &) const
Provide human-readable information about object.
Definition: oof1.cpp:342
tableValidT validStatus() const
Definition: oof1.h:1802
static dbConnect * currentlyConstructing()
Definition: oof1.h:1633
void operator!()
Operator performing invert set operation.
Definition: oof1.h:2184
int validatingDepth() const
Definition: oof1.h:1809
virtual dbSorter * clone() const
Definition: oof1.cpp:2918
bool mHasStoredCalculators
Definition: oof1.h:1236
saveOptionsT tableSaveOption() const
Definition: oof1.h:2394
virtual ~OOF_PublicBase()
Definition: oof1.h:57
oofString mSchemaFileName
Definition: oof1.h:1022
listener for an MN link that adds and deletes records.
Definition: oof1.h:1456
connectionFileStateT mFileState
Definition: oof1.h:1028
unsigned long sequenceNumber() const
Definition: oof1.h:1843
oofDirectory * databaseDirectory() const
Definition: oof1.h:1683
bool EntryMatchesVisibility(const OOF_PublicBase *, bool) const
Definition: oof1.h:1526
void fieldHasStoredCalculator(dbField *)
Definition: oof1.h:1747
OOFILE_EXPORT std::ostream & operator<<(std::ostream &, OOF_IndexOptions)
OOF_FieldSegOwner & operator>>(dbField &)
Definition: oof1.cpp:2868
virtual const char * defaultName() const
Definition: oof1.h:467
bool more() const
Definition: oof1.h:1512
void difference_with(dbTable &)
Definition: oof1.cpp:2572
bool mAllowShortImports
Definition: oof1.h:794
virtual void describe(std::ostream &) const
Definition: oof1.cpp:2937
virtual unsigned short sortFieldNo() const
Definition: oof1.cpp:3038
static OOF_bitPointer & missingItem()
Definition: oof1.h:1622
Cleanup after cloning a dbTable to get separate iterator.
Definition: oof1.h:1433
OOF_bitPointer & operator()()
Definition: oof1.h:1572
unsigned long recordNumberOfOID(oidT inOID)
Find ordinal position in ordered selection of record by OID.
Definition: oof1.h:2056
Generic broadcaster for messaging.
Definition: oofmsg.h:76
Provides cross-platform directory specification and iteration.
Definition: ooffiles.h:235
OOF_IndexOptions
type used to specify index options for dbField's.
Definition: oof1.h:236
Separate out statics from dbTable.
Definition: oof1.h:839
int mValidatingDepth
Definition: oof1.h:796
virtual void sortNow(OOF_tableBackend *)
Definition: oof1.cpp:2980
Abstract factory for dbGUI.
Definition: oof1.h:298
OOF_bitPointer & operator[](unsigned int)
Definition: oof1.h:1608
Abstraction of common runtime environment stuff you'd call.
Definition: oof1.h:900
dbTableAssigner & operator<<(const char *)
Definition: oof1.h:1757
bool tableCachesDirtyRecords() const
Definition: oof1.h:2383
bool inDeclarativePhase() const
Connection has been declared but not opened or created.
Definition: oof1.h:1702
Internal class used to specify segments for dbCompoundField and dbSorter.
Definition: oof3.h:637
Representation of ref-counted dictionary.
Definition: oof1.h:121
reversed(dbField &fld)
Definition: oof1.h:1323
void operator&=(dbTable &)
Operator performing intersection_with set operation.
Definition: oof1.h:2154
bool mSuspended
Definition: oof1.h:1312
void next()
Definition: oof1.h:1519
unsigned long OOFmsgT
Definition: oofmsg.h:31
oofWordParser * mDefaultPrototypeParser
Definition: oof1.h:1024
dbGUI * mGUI
Definition: oof1.h:797
bool transactionDirty()
Definition: oof1.h:2456
dbSorter * sorter() const
Definition: oof1.h:2415
fieldNumT numFields() const
Definition: oof1.h:1864
const oofString & connectionName() const
Definition: oof1.h:1640
Database connection to a RAM database that can be persisted out to a single file. ...
Definition: ooframp.h:26
static dbTable::selSharingT sCloningSelSharing
Definition: oof1.h:843
void ensureSelectionLoaded()
Definition: oof1.h:2005
void unlockRecord()
Definition: oof1.h:2447
void startVisible(bool wantVisible=true)
Definition: oof1.h:1535
Persistent field used to store an arbitrary binary object.
Definition: oof3.h:387
void union_with(dbTable &)
Definition: oof1.cpp:2605
selSharingT
Definition: oof1.h:463
bool isNewRecord() const
Definition: oof1.h:2341
void intersection_with(dbTable &)
Definition: oof1.cpp:2651
dbTable * mTable
Definition: oof1.h:1234
OOF_Dictionary mFields
Definition: oof1.h:789
void incRefs()
Definition: oof1.h:2677
bool mOwnsContents
Definition: oof1.h:215
#define OOFILE_EXPORT
Prefix for OOFILE database & general classes to enable optional DLL linking.
Definition: oof0.h:187
static dbGUIFactory * sGUIFactory
Definition: oof1.h:305
OOF_Dictionary mTables
Definition: oof1.h:1020
void markDirty()
Definition: oof1.h:1712
Stack class to combine stSuspendSort and stSaveSelection.
Definition: oof1.h:1386
void ownsContents(bool ownsFlag=true)
Definition: oof1.h:2557
OOF_Dictionary mFields
Definition: oof1.h:1233
OOF_bitPointer pop()
Definition: oof1.h:1558
oidT currentOID()
Absolute record address of current record.
Definition: oof1.h:1938
Stack class to temporarily suspend sorting.
Definition: oof1.h:1372
dbTable * mTable
Definition: oof1.h:441
void pack()
Definition: oof1.h:2463
static OOF_bitPointer sMissingItem
Definition: oof1.h:216
bool skipTillDigit(std::istream &, char fieldSep=dbTable::kFieldSep, char recSep=dbTable::kRecSep)
Binary query where LHS is table, eg: dbTable::hasAllWordsDelimited.
Definition: oofquery.h:130
void setTableValid(bool isValid=true)
Force current table state to valid.
Definition: oof1.h:1875
void union_with_no_overlap(dbTable &)
Definition: oof1.cpp:2628
dbSelection mSavedSelection
Definition: oof1.h:400
unsigned int mInternalIter
Definition: oof1.h:214
OOF_mixRefCount(unsigned long initialRefs=1)
Definition: oof1.h:2672
Base class for persistent fields in dbTable's.
Definition: oof3.h:63
bool isRecordLoaded() const
Definition: oof1.h:1823
unsigned int * mSharedReferences
Definition: oof1.h:112
unsigned int numIndexes() const
Definition: oof1.h:1850
Provides searchable dictionary of common OOFILE classes like dbTable.
Definition: oof1.h:159
bool atLast() const
Definition: oof1.h:1920
oofString mConnectionName
Definition: oof1.h:1021
Abstract interface for database.
Definition: oof1.h:920