예제 #1
0
 public RecordSet(string Directory, string Name, Schema S, long MaxRecords)
     : this(S)
 {
     this.MaxRecords = MaxRecords;
     Header h = new Header(Directory, Name, 0, this, HeaderType.Table);
     this.Attach(h);
     BinarySerializer.FlushRecordSet(this);
 }
예제 #2
0
 // Constructor //
 public RecordSet(Schema NewColumns, Header NewHeader, List<Record> NewCache, Key NewOrderBy)
 {
     this._Columns = NewColumns;
     this._Cache = NewCache;
     this._OrderBy = NewOrderBy;
     this._Head = NewHeader;
     if (NewHeader != null)
     {
         this._MaxRecordCount = NewHeader.MaxRecordCount;
         this._GhostName = NewHeader.Name;
     }
     else
     {
         this._MaxRecordCount = EstimateMaxRecords(NewColumns);
         this._GhostName = "CHUNK";
     }
 }
예제 #3
0
 public static KeyValueSet Open(Header h, FNodeSet Fields, AggregateSet CR)
 {
     RecordSet rs = BinarySerializer.BufferRecordSet(h.Path);
     KeyValueSet gbs = new KeyValueSet(Fields, CR);
     gbs.ImportFromInterim(rs);
     return gbs;
 }
예제 #4
0
 public static void Save(Header H, KeyValueSet Data)
 {
     RecordSet rs = Data.ToInterim();
     rs.Attach(H);
     BinarySerializer.FlushRecordSet(rs);
 }
예제 #5
0
파일: Header.cs 프로젝트: pwdlugosz/Horse
 // Statics //
 public static string FilePath(string Dir, string Name, HeaderType Type)
 {
     Header h = new Header(Dir.Trim(), Name.Trim(), 0, 0, 0, 0, 0, Type);
     return h.Path;
 }
예제 #6
0
        private static RecordSet ReadRecordSet(BinaryReader Reader)
        {

            /*
             * Read:
             *      Header
             *      Schema
             *      SortKey
             *      Record Collection
             */

            // Read header //
            Header h = new Header(BinarySerializer.ReadRecord(Reader, 10));

            // Read schema //
            Schema s = new Schema(BinarySerializer.ReadRecords(Reader, h.ColumnCount, 4));

            // Read key //
            Key k = new Key(BinarySerializer.ReadRecord(Reader, (int)h.KeyCount));

            // Read record cache //
            List<Record> l = BinarySerializer.ReadRecords(Reader, h.RecordCount, s.Count);

            // Return recordset //
            return new RecordSet(s, h, l, k);

        }
예제 #7
0
 public static RecordSet BufferRecordSet(Header H)
 {
     return BufferRecordSet(H.Path);
 }
예제 #8
0
        private static RecordSet ReadRecordSetSafe2(byte[] Mem, int Location)
        {

            /*
             * Read:
             *      Header
             *      Schema
             *      SortKey
             *      Record Collection
             */

            // Read header //
            Record rh;
            Location = ReadRecordSafe2(Mem, Location, 10, out rh);
            Header h = new Header(rh);
            
            // Read schema //
            List<Record> s_cache = new List<Record>();
            Location = BinarySerializer.ReadRecordsSafe2(Mem, Location, h.ColumnCount, 4, s_cache);
            Schema s = new Schema(s_cache);
            
            // Read key //
            Record rk;
            Location = ReadRecordSafe2(Mem, Location, (int)h.KeyCount, out rk);
            Key k = new Key(rk);
            
            // Read record cache //
            List<Record> d_cache = new List<Record>();
            Location = BinarySerializer.ReadRecordsSafe2(Mem, Location, (int)h.RecordCount, (int)h.ColumnCount, d_cache);
            
            // Return recordset //
            return new RecordSet(s, h, d_cache, k);

        }
예제 #9
0
파일: Indexing.cs 프로젝트: pwdlugosz/Horse
 public SmallIndexSet(string SinkDir, DataSet Data, Key K)
     : this(Data, K)
 {
     Header h = new Header(SinkDir, Header.TempName(), 0, this, HeaderType.Table);
     this.Attach(h);
 }
예제 #10
0
 public static void RenameRecordSet(Header H, string NewName)
 {
     RenameRecordSet(H.Path, NewName);
 }
예제 #11
0
 public static void DropRecordSet(Header H)
 {
     DropRecordSet(H.Path);
 }
예제 #12
0
 public static bool Exists(Header Data)
 {
     return Exists(Data.Path);
 }
예제 #13
0
 public RecordSet(string ColumnText, Header NewHeader)
     : this(new Schema(ColumnText), NewHeader)
 {
 }
예제 #14
0
        public RecordSet(Schema NewColumns, Header NewHeader)
            : this(NewColumns, NewHeader, new List<Record>(), new Key())
        {

        }
예제 #15
0
 internal void Attach(Header Meta)
 {
     this._Head = Meta;
 }