public SearchResult(DatabaseRoot root, VersionHistory type, string uri, NameVal[] patterns, SearchKind kind, DateTime timestamp, IEnumerator iterator)
 {
     this.root      = root;
     this.type      = type;
     this.uri       = uri;
     this.patterns  = patterns;
     this.kind      = kind;
     this.timestamp = timestamp;
     this.iterator  = iterator;
 }
 public ReferenceIterator(DatabaseRoot root, PropDef[] defs, IEnumerator iterator, SearchKind kind, DateTime timestamp)
 {
     this.root      = root;
     this.defs      = defs;
     this.kind      = kind;
     this.timestamp = timestamp;
     iterators      = new IEnumerator[defs.Length + 1];
     iterators[iterators.Length - 1] = iterator;
     Reset();
 }
 /// <summary>Open database</summary>
 /// <param name="filePath">path to the database file</param>
 public void Open(string filePath)
 {
     db = StorageFactory.Instance.CreateStorage();
     db.Open(filePath);
     root = (DatabaseRoot)db.Root;
     if (root == null)
     {
         root = new DatabaseRoot();
         root.prefixUriIndex = db.CreateIndex(typeof(string), true);
         root.suffixUriIndex = db.CreateIndex(typeof(string), true);
         root.strPropIndex   = db.CreateIndex(new Type[] { typeof(PropDef), typeof(string) }, false);
         root.numPropIndex   = db.CreateIndex(new Type[] { typeof(PropDef), typeof(double) }, false);
         root.refPropIndex   = db.CreateIndex(new Type[] { typeof(PropDef), typeof(VersionHistory) }, false);
         root.timePropIndex  = db.CreateIndex(new Type[] { typeof(PropDef), typeof(DateTime) }, false);
         root.propDefIndex   = db.CreateFieldIndex(typeof(PropDef), "name", true);
         root.timeIndex      = db.CreateFieldIndex(typeof(Thing), "timestamp", false);
         root.inverseIndex   = db.CreateIndex(typeof(string), false);
         root.spatialIndex   = db.CreateSpatialIndexR2();
         root.latest         = db.CreateSet();
         CreateMetaType();
         db.Root = root;
     }
 }
 /// <summary>Open database</summary>
 /// <param name="filePath">path to the database file</param>    
 public void Open(string filePath) 
 { 
     db = StorageFactory.Instance.CreateStorage(); 
     db.Open(filePath);
     root = (DatabaseRoot)db.Root;
     if (root == null) 
     {
         root = new DatabaseRoot();
         root.prefixUriIndex = db.CreateIndex(typeof(string), true);
         root.suffixUriIndex = db.CreateIndex(typeof(string), true);
         root.strPropIndex = db.CreateIndex(new Type[]{typeof(PropDef), typeof(string)}, false);
         root.numPropIndex = db.CreateIndex(new Type[]{typeof(PropDef), typeof(double)}, false);
         root.refPropIndex = db.CreateIndex(new Type[]{typeof(PropDef), typeof(VersionHistory)}, false);
         root.timePropIndex = db.CreateIndex(new Type[]{typeof(PropDef), typeof(DateTime)}, false);
         root.propDefIndex = db.CreateFieldIndex(typeof(PropDef), "name", true);            
         root.timeIndex = db.CreateFieldIndex(typeof(Thing), "timestamp", false);
         root.inverseIndex = db.CreateIndex(typeof(string), false);
         root.spatialIndex = db.CreateSpatialIndexR2();
         root.latest = db.CreateSet();
         CreateMetaType();
         db.Root = root;
     }
 }
 public SearchResult(DatabaseRoot root, VersionHistory type, string uri, NameVal[] patterns, SearchKind kind, DateTime timestamp, IEnumerator iterator) 
 {
     this.root = root;
     this.type = type;    
     this.uri = uri;    
     this.patterns = patterns;    
     this.kind = kind;    
     this.timestamp = timestamp;    
     this.iterator = iterator;    
 }
 public ReferenceIterator(DatabaseRoot root, PropDef[] defs, IEnumerator iterator, SearchKind kind, DateTime timestamp) 
 {
     this.root = root;
     this.defs = defs;
     this.kind = kind;
     this.timestamp = timestamp;
     iterators = new IEnumerator[defs.Length+1];
     iterators[iterators.Length-1] = iterator;
     Reset();
 }