• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# RowSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中RowSet的典型用法代码示例。如果您正苦于以下问题:C# RowSet类的具体用法?C# RowSet怎么用?C# RowSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RowSet类属于命名空间,在下文中一共展示了RowSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Process

        /// <summary>
        /// Main processing script.
        /// </summary>
        /// <param name="input">The input row.</param>
        /// <param name="outputRow">The output row.</param>
        /// <param name="args">The arguments.</param>
        /// <returns>The IEnumerable output row.</returns>
        public override IEnumerable<Row> Process(RowSet input, Row outputRow, string[] args)
        {
            string frameShift = args[0];
            string frameLength = args[1];

            Directory.CreateDirectory("relatedFeatures");

            foreach (var row in input.Rows)
            {
                outputRow["WaveID"].Set(row["WaveID"].String);
                outputRow["WaveBinary"].Set(row["WaveBinary"].Binary);
                outputRow["WaveAlignments"].Set(row["WaveAlignments"].String);
                outputRow["RawF0"].Set(row["RawF0"].String);
                outputRow["LPCC"].Set(row["LPCC"].Binary);
                outputRow["OF0"].Set(row["OF0"].String);
                outputRow["LSP"].Set(row["LSP"].Binary);
                outputRow["Pow"].Set(row["Pow"].String);
                outputRow["MBE"].Set(row["MBE"].String);
                outputRow["NCCF"].Set(row["NCCF"].String);

                string waveId = row["WaveID"].String;
                string wave = JobBase.GenerateLocalFile(waveId, row["WaveBinary"].Binary, FileExtensions.Waveform);

                string relatedFeatureFile = Path.Combine("relatedFeatures", waveId + "." + FileExtensions.Text);
                string[] argument = { wave, relatedFeatureFile, frameShift, frameLength };
                F0ExtractorCOSMOS.ExtractRelatedFeaturesOneFile(argument, null);

                outputRow["RF"].Set(File.ReadAllText(relatedFeatureFile));
                yield return outputRow;
            }
        }
开发者ID:JohnsonYuan,项目名称:TTSFramework,代码行数:38,代码来源:GetRelatedFeatureJob.cs


示例2: valueComparator

 internal static void valueComparator(RowSet rawrowset, List<object[]> insertedRows)
 {
     List<Row> rowset = rawrowset.GetRows().ToList();
     Assert.True(rowset.Count == insertedRows.Count,
                 string.Format(
                     "Returned rows count is not equal with the count of rows that were inserted! \n Returned: {0} \n Expected: {1} \n",
                     rowset.Count, insertedRows.Count));
     int i = 0;
     foreach (Row row in rowset)
     {
         if (row.Any(col => col.GetType() == typeof (byte[])))
             for (int j = 0; j < row.Length; j++)
             {
                 Assert.AreEqual(insertedRows[i][j], row[j]);
             }
         else
         {
             for (int m = 0; m < row.Length; m++)
             {
                 if (!row[m].Equals(insertedRows[i][m]))
                 {
                     insertedRows.Reverse(); // To check if needed and why 
                     if (!row[m].Equals(insertedRows[i][m]))
                         insertedRows.Reverse();
                 }
                 Assert.AreEqual(insertedRows[i][m], row[m], "Inserted data does not match with returned data.");
             }
         }
         i++;
     }
 }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:31,代码来源:QueryTools.cs


示例3: CreateStringsRowset

 /// <summary>
 /// Creates a rowset.
 /// The columns are named: col_0, ..., col_n
 /// The rows values are: row_0_col_0, ..., row_m_col_n
 /// </summary>
 public RowSet CreateStringsRowset(int columnLength, int rowLength, string valueModifier = null)
 {
     var columns = new List<CqlColumn>();
     var columnIndexes = new Dictionary<string, int>();
     for (var i = 0; i < columnLength; i++)
     {
         var c = new CqlColumn()
         {
             Index = i,
             Name = "col_" + i,
             TypeCode = ColumnTypeCode.Text,
             Type = typeof(string)
         };
         columns.Add(c);
         columnIndexes.Add(c.Name, c.Index);
     }
     var rs = new RowSet();
     for (var j = 0; j < rowLength; j++)
     {
         var rowValues = new List<byte[]>();
         foreach (var c in columns)
         {
             var value = valueModifier + "row_" + j + "_col_" + c.Index;
             rowValues.Add(Encoding.UTF8.GetBytes(value));
         }
         rs.AddRow(new Row(1, rowValues.ToArray(), columns.ToArray(), columnIndexes));
     }
     return rs;
 }
开发者ID:rasmus-s,项目名称:csharp-driver,代码行数:34,代码来源:RowSetUnitTests.cs


示例4: Process

        /// <summary>
        /// Main processing script.
        /// </summary>
        /// <param name="input">The input row.</param>
        /// <param name="outputRow">The output row.</param>
        /// <param name="args">The arguments.</param>
        /// <returns>The IEnumerable output row.</returns>
        public override IEnumerable<Row> Process(RowSet input, Row outputRow, string[] args)
        {
            string svmDir = "svm";
            string scaledSVMDir = "scaledSVM";
            Directory.CreateDirectory(svmDir);
            Directory.CreateDirectory(scaledSVMDir);

            foreach (var row in input.Rows)
            {
                outputRow["WaveID"].Set(row["WaveID"].String);
                outputRow["WaveBinary"].Set(row["WaveBinary"].Binary);
                outputRow["WaveAlignments"].Set(row["WaveAlignments"].String);
                outputRow["RawF0"].Set(row["RawF0"].String);
                outputRow["LPCC"].Set(row["LPCC"].Binary);
                outputRow["OF0"].Set(row["OF0"].String);
                outputRow["LSP"].Set(row["LSP"].Binary);
                outputRow["Pow"].Set(row["Pow"].String);
                outputRow["MBE"].Set(row["MBE"].String);

                string waveId = row["WaveID"].String;
                string svmFile = JobBase.GenerateLocalFile(waveId, row["SVM"].String, FileExtensions.Text, false, svmDir);
                string scaledSVMFile = Path.Combine(scaledSVMDir, waveId + "." + FileExtensions.Text);
                string svmRangeFile = Path.GetFileName(this.Job.ReplaceVariable["SVMRANGE"]);

                // File.WriteAllText(svmRangeFile, TmocFile.NormalizeOutput(svmRangeFile)).
                string argument = Helper.NeutralFormat(" -r \"{0}\" \"{1}\"", svmRangeFile, svmFile);
                DelayedLogger logger = new DelayedLogger(new TextLogger(scaledSVMFile));
                CommandLine.RunCommand(Path.GetFileName(this.Job.ReplaceVariable["SVMSCALETOOL"]),
                    argument, Environment.CurrentDirectory, logger.Writer, logger.Writer, null);
                logger.Dispose();
                outputRow["SSVM"].Set(File.ReadAllText(scaledSVMFile));

                yield return outputRow;
            }
        }
开发者ID:JohnsonYuan,项目名称:TTSFramework,代码行数:42,代码来源:ScaleFeatureJob.cs


示例5: Reduce

    public override IEnumerable<Row> Reduce(RowSet input, Row output, string[] args)
    {
        DateTime lastLogin = default(DateTime);
        int sessionId = 1;
        foreach (Row row in input.Rows)
        {
            DateTime currentLoginTime = (DateTime)row["logintime"].Value;
            if (lastLogin == default(DateTime))
            {
                lastLogin = currentLoginTime;
            }
            else
            {
                if (lastLogin.AddMinutes(30) < currentLoginTime)
                    sessionId++;

                lastLogin = currentLoginTime;
            }

            row.CopyTo(output);
            output["sessionId"].Set(sessionId);
            yield return output;

        }
    }
开发者ID:aaadith,项目名称:MyCosmosSamples,代码行数:25,代码来源:UsingNormalReducer.script.cs


示例6: Process

        /// <summary>
        /// Main processing script.
        /// </summary>
        /// <param name="input">The input row.</param>
        /// <param name="outputRow">The output row.</param>
        /// <param name="args">The arguments.</param>
        /// <returns>The IEnumerable output row.</returns>
        public override IEnumerable<Row> Process(RowSet input, Row outputRow, string[] args)
        {
            string uvDir = "uv";
            string scaledSVMDir = "scaledSVM";
            Directory.CreateDirectory(uvDir);
            Directory.CreateDirectory(scaledSVMDir);

            foreach (var row in input.Rows)
            {
                outputRow["WaveID"].Set(row["WaveID"].String);
                outputRow["WaveBinary"].Set(row["WaveBinary"].Binary);
                outputRow["WaveAlignments"].Set(row["WaveAlignments"].String);
                outputRow["RawF0"].Set(row["RawF0"].String);
                outputRow["LPCC"].Set(row["LPCC"].Binary);
                outputRow["OF0"].Set(row["OF0"].String);
                outputRow["LSP"].Set(row["LSP"].Binary);
                outputRow["Pow"].Set(row["Pow"].String);
                outputRow["MBE"].Set(row["MBE"].String);

                string waveId = row["WaveID"].String;
                string scaledSVMFile = JobBase.GenerateLocalFile(waveId, row["SSVM"].String, FileExtensions.Text, false, scaledSVMDir);
                string uvFile = Path.Combine(uvDir, waveId + "." + FileExtensions.Text);
                string argument = Helper.NeutralFormat(" \"{0}\" \"{1}\" \"{2}\"", scaledSVMFile, Path.GetFileName(this.Job.ReplaceVariable["UVMODELFILE"]), uvFile);

                CommandLine.RunCommand(Path.GetFileName(this.Job.ReplaceVariable["SVMPREDICTTOOL"]),
                    argument, "./");
                outputRow["UV"].Set(JobBase.GetTextFile(uvFile));
                yield return outputRow;
            }
        }
开发者ID:JohnsonYuan,项目名称:TTSFramework,代码行数:37,代码来源:PredictUVJob.cs


示例7: Process

        /// <summary>
        /// Main processing script.
        /// </summary>
        /// <param name="input">The input row.</param>
        /// <param name="outputRow">The output row.</param>
        /// <param name="args">The arguments.</param>
        /// <returns>The IEnumerable output row.</returns>
        public override IEnumerable<Row> Process(RowSet input, Row outputRow, string[] args)
        {
            string f0Dir = "f0";
            string expandDir = "expand";
            string svmDir = "svm";
            Directory.CreateDirectory(f0Dir);
            Directory.CreateDirectory(expandDir);
            Directory.CreateDirectory(svmDir);

            foreach (var row in input.Rows)
            {
                outputRow["WaveID"].Set(row["WaveID"].String);
                outputRow["WaveBinary"].Set(row["WaveBinary"].Binary);
                outputRow["WaveAlignments"].Set(row["WaveAlignments"].String);
                outputRow["RawF0"].Set(row["RawF0"].String);
                outputRow["LPCC"].Set(row["LPCC"].Binary);
                outputRow["OF0"].Set(row["OF0"].String);
                outputRow["LSP"].Set(row["LSP"].Binary);
                outputRow["Pow"].Set(row["Pow"].String);
                outputRow["MBE"].Set(row["MBE"].String);

                string waveId = row["WaveID"].String;
                string f0File = JobBase.GenerateLocalFile(waveId, row["RawF0"].String, FileExtensions.F0File, true, f0Dir);
                string expandFeatureFile = JobBase.GenerateLocalFile(waveId, row["EXP"].String, FileExtensions.Text, false, expandDir);
                string svmFile = Path.Combine(svmDir, waveId + "." + FileExtensions.Text);

                string[] argument = { f0File, expandFeatureFile, svmFile };
                F0ExtractorCOSMOS.FormatFeaturesOneFile(argument, null);

                outputRow["SVM"].Set(File.ReadAllText(svmFile));
                yield return outputRow;
            }
        }
开发者ID:JohnsonYuan,项目名称:TTSFramework,代码行数:40,代码来源:FormatFeatureJob.cs


示例8: Process

        /// <summary>
        /// Main processing script.
        /// </summary>
        /// <param name="input">The input row.</param>
        /// <param name="outputRow">The output row.</param>
        /// <param name="args">The arguments.</param>
        /// <returns>The IEnumerable output row.</returns>
        public override IEnumerable<Row> Process(RowSet input, Row outputRow, string[] args)
        {
            float minF0Value = float.Parse(args[0]);
            float maxF0Value = float.Parse(args[1]);
            string uvDir = "uv";
            string fZeroDir = "f0";
            string smoothedFZeroDir = "smoothedF0";

            Directory.CreateDirectory(uvDir);
            Directory.CreateDirectory(fZeroDir);
            Directory.CreateDirectory(smoothedFZeroDir);

            foreach (var row in input.Rows)
            {
                outputRow["WaveID"].Set(row["WaveID"].String);
                outputRow["WaveBinary"].Set(row["WaveBinary"].Binary);
                outputRow["WaveAlignments"].Set(row["WaveAlignments"].String);
                outputRow["RawF0"].Set(row["RawF0"].String);
                outputRow["LPCC"].Set(row["LPCC"].Binary);
                outputRow["OF0"].Set(row["OF0"].String);
                outputRow["LSP"].Set(row["LSP"].Binary);
                outputRow["Pow"].Set(row["Pow"].String);
                outputRow["MBE"].Set(row["MBE"].String);

                string waveId = row["WaveID"].String;
                string f0File = JobBase.GenerateLocalFile(waveId, row["RawF0"].String, FileExtensions.F0File, true, fZeroDir);
                string uvFile = JobBase.GenerateLocalFile(waveId, row["UV"].String, FileExtensions.Text, true, uvDir);
                string smoothedF0File = Path.Combine(smoothedFZeroDir, waveId + "." + FileExtensions.F0File);
                string[] argument = { f0File, uvFile, smoothedF0File, minF0Value.ToString(), maxF0Value.ToString() };
                F0ExtractorCOSMOS.SmoothOneF0File(argument, null);
                outputRow["SF0"].Set(JobBase.GetTextFile(smoothedF0File));
                yield return outputRow;
            }
        }
开发者ID:JohnsonYuan,项目名称:TTSFramework,代码行数:41,代码来源:SmoothF0Job.cs


示例9: CqlReader

 internal CqlReader(RowSet rows)
 {
     popul = rows;
     for (int idx = 0; idx < popul.Columns.Length; idx++)
         colidx.Add(popul.Columns[idx].Name, idx);
     enumRows = popul.GetRows();
     enumerRows = enumRows.GetEnumerator();
 }
开发者ID:rasmus-s,项目名称:csharp-driver,代码行数:8,代码来源:CqlReader.cs


示例10: AddDataToWorksheet

 private void AddDataToWorksheet(RowSet resultset, Excel.Range target, bool useFormula)
 {
     var rgTitles = target.Resize[1, resultset.ColLen];
     Utils.AddTitlesToRange(rgTitles, resultset.Titles);
     var rgData = ((Excel.Range)target.Cells[2, 1]).Resize[resultset.RowLen, resultset.ColLen];
     Utils.AddDataToRange(rgData, resultset.Data, useFormula);
     Utils.AddTagsToRange(rgData, resultset.Diff, ctrlInteriorColor.SelectedColor, ctrlFontColor.SelectedColor);
 }
开发者ID:alnemer,项目名称:excel-qa-tools,代码行数:8,代码来源:FrmCompare.cs


示例11: FetchAsync_Pocos_WithCql_Empty

 public void FetchAsync_Pocos_WithCql_Empty()
 {
     var rowset = new RowSet();
     var mappingClient = GetMappingClient(rowset);
     var userTask = mappingClient.FetchAsync<PlainUser>("SELECT * FROM users");
     var users = userTask.Result;
     Assert.NotNull(users);
     Assert.AreEqual(0, users.Count());
 }
开发者ID:Virus-X,项目名称:csharp-driver,代码行数:9,代码来源:FetchTests.cs


示例12: Process

        /// <summary>
        /// Main processing script.
        /// </summary>
        /// <param name="input">The input row.</param>
        /// <param name="outputRow">The output row.</param>
        /// <param name="args">The arguments.</param>
        /// <returns>The IEnumerable output row.</returns>
        public override IEnumerable<Row> Process(RowSet input, Row outputRow, string[] args)
        {
            foreach (var row in input.Rows)
            {
                outputRow["WaveID"].Set(row["WaveID"].String);
                outputRow["SVM"].Set(row["SVM"].String);

                yield return outputRow;
            }
        }
开发者ID:JohnsonYuan,项目名称:TTSFramework,代码行数:17,代码来源:ConvertSVMToStreamJob.cs


示例13: GetSession

 private ISession GetSession(RowSet result)
 {
     var sessionMock = new Mock<ISession>(MockBehavior.Strict);
     sessionMock
         .Setup(s => s.ExecuteAsync(It.IsAny<IStatement>()))
         .Returns(TestHelper.DelayedTask(result, 200))
         .Verifiable();
     sessionMock.Setup(s => s.PrepareAsync(It.IsAny<string>())).Returns(TaskHelper.ToTask(GetPrepared("Mock query")));
     sessionMock.Setup(s => s.BinaryProtocolVersion).Returns(2);
     return sessionMock.Object;
 }
开发者ID:alprema,项目名称:csharp-driver,代码行数:11,代码来源:LinqMappingUnitTests.cs


示例14: CommandExecuteReaderUsesSyncExecute

        public void CommandExecuteReaderUsesSyncExecute()
        {
            var connection = new CqlConnection();
            var sessionMock = new Mock<ISession>();
            var rowset = new RowSet();
            sessionMock
                .Setup(s => s.Execute(It.IsAny<string>(), It.IsAny<ConsistencyLevel>()))
                .Returns(rowset)
                .Verifiable();
            connection.ManagedConnection = sessionMock.Object;

            var cmd = (CqlCommand) connection.CreateCommand();
            cmd.CommandText = "INSERT INTO dummy_cf (a,b) VALUES (1,2)";
            var reader = cmd.ExecuteReader();
            reader.Dispose();
            sessionMock.Verify();
        }
开发者ID:mtf30rob,项目名称:csharp-driver,代码行数:17,代码来源:AdoUnitTests.cs


示例15: AddColumnInfoToWorksheet

 private void AddColumnInfoToWorksheet(RowSet resultset, Excel.Range target)
 {
     object[,] info = ExcelArray<object>.Create(resultset.RowLen, 1);
     var rgTitles = (Excel.Range)target.Rows[0];
     var rgInfo = (Excel.Range)target.Columns[0];
     for (int ri = 1; ri <= resultset.RowLen; ri++) {
         switch (resultset.Match[ri]) {
             case XlRowMatch.MatchWithDiff: info[ri, 1] = "'!="; break;
             case XlRowMatch.NoMatch: info[ri, 1] = "'+"; break;
         }
     }
     Utils.SetCellStyle(rgInfo, 0xFF);
     rgTitles.Value = resultset.Titles;
     rgTitles.Font.Bold = true;
     rgInfo.Value = info;
     rgInfo.HorizontalAlignment = Excel.Constants.xlCenter;
     rgInfo.ColumnWidth = 2.5;
 }
开发者ID:alnemer,项目名称:excel-qa-tools,代码行数:18,代码来源:FrmCompare.cs


示例16: Process

        /// <summary>
        /// Main processing script.
        /// </summary>
        /// <param name="input">The input row.</param>
        /// <param name="outputRow">The output row.</param>
        /// <param name="args">The arguments.</param>
        /// <returns>The IEnumerable output row.</returns>
        public override IEnumerable<Row> Process(RowSet input, Row outputRow, string[] args)
        {
            string frameShift = args[0];
            string frameLength = args[1];

            string waveDir = "wave";
            string lpcDir = "lpc";
            string residual0Dir = "residual";
            Directory.CreateDirectory(waveDir);
            Directory.CreateDirectory(lpcDir);
            Directory.CreateDirectory(residual0Dir);

            foreach (var row in input.Rows)
            {
                outputRow["WaveID"].Set(row["WaveID"].String);
                outputRow["WaveBinary"].Set(row["WaveBinary"].Binary);
                outputRow["WaveAlignments"].Set(row["WaveAlignments"].String);
                outputRow["RawF0"].Set(row["RawF0"].String);
                outputRow["LPCC"].Set(row["LPCC"].Binary);
                outputRow["OF0"].Set(row["OF0"].String);
                outputRow["LSP"].Set(row["LSP"].Binary);
                outputRow["Pow"].Set(row["Pow"].String);
                outputRow["MBE"].Set(row["MBE"].String);
                outputRow["NCCF"].Set(row["NCCF"].String);
                outputRow["RF"].Set(row["RF"].String);

                string waveId = row["WaveID"].String;
                string waveFile = JobBase.GenerateLocalFile(waveId, row["WaveBinary"].Binary, FileExtensions.Waveform, waveDir);
                string lpcFile = JobBase.GenerateLocalFile(waveId, row["LPC"].String, FileExtensions.F0File, false, lpcDir);
                string errorFile = Path.Combine(residual0Dir, waveId + "." + FileExtensions.Text);

                string[] argument = { waveFile, lpcFile, errorFile, frameShift, frameLength };
                F0ExtractorCOSMOS.ExtractLpcResidualErrorOneFile(argument, null);

                outputRow["ERR"].Set(File.ReadAllText(errorFile));
                yield return outputRow;
            }
        }
开发者ID:JohnsonYuan,项目名称:TTSFramework,代码行数:45,代码来源:GetLpcResidualErrorJob.cs


示例17: Process

        /// <summary>
        /// Main processing script.
        /// </summary>
        /// <param name="input">The input row.</param>
        /// <param name="outputRow">The output row.</param>
        /// <param name="args">The arguments.</param>
        /// <returns>The IEnumerable output row.</returns>
        public override IEnumerable<Row> Process(RowSet input, Row outputRow, string[] args)
        {
            string relatedFeatureDir = "relatedFeature";
            string residualDir = "residual";
            string nccfDir = "nccf";
            string mergedDir = "merged";
            Directory.CreateDirectory(relatedFeatureDir);
            Directory.CreateDirectory(residualDir);
            Directory.CreateDirectory(nccfDir);
            Directory.CreateDirectory(mergedDir);

            foreach (var row in input.Rows)
            {
                outputRow["WaveID"].Set(row["WaveID"].String);
                outputRow["WaveBinary"].Set(row["WaveBinary"].Binary);
                outputRow["WaveAlignments"].Set(row["WaveAlignments"].String);
                outputRow["RawF0"].Set(row["RawF0"].String);
                outputRow["LPCC"].Set(row["LPCC"].Binary);
                outputRow["OF0"].Set(row["OF0"].String);
                outputRow["LSP"].Set(row["LSP"].Binary);
                outputRow["Pow"].Set(row["Pow"].String);
                outputRow["MBE"].Set(row["MBE"].String);

                string waveId = row["WaveID"].String;
                string relatedFeatureFile = JobBase.GenerateLocalFile(waveId, row["RF"].String, FileExtensions.Text, false, relatedFeatureDir);
                string residualFile = JobBase.GenerateLocalFile(waveId, row["ERR"].String, FileExtensions.Text, false, residualDir);
                string nccfFile = JobBase.GenerateLocalFile(waveId, row["NCCF"].String, FileExtensions.F0File, true, nccfDir);
                string mergedFeatureFile = Path.Combine(mergedDir, waveId + "." + FileExtensions.Text);

                string[] argument = { relatedFeatureFile, residualFile, nccfFile, mergedFeatureFile };
                F0ExtractorCOSMOS.MergeFeaturesOneFile(argument, null);

                outputRow["MERG"].Set(File.ReadAllText(mergedFeatureFile));
                yield return outputRow;
            }
        }
开发者ID:JohnsonYuan,项目名称:TTSFramework,代码行数:43,代码来源:MergeFeatureJob.cs


示例18: sqlite3RowSetInsert

 /*
 ** Insert a new value into a RowSet.
 **
 ** The mallocFailed flag of the database connection is set if a
 ** memory allocation fails.
 */
 static void sqlite3RowSetInsert( RowSet p, i64 rowid )
 {
     RowSetEntry pEntry;       /* The new entry */
       RowSetEntry pLast;        /* The last prior entry */
       Debug.Assert( p != null );
       if ( p.nFresh == 0 )
       {
     RowSetChunk pNew;
     pNew = new RowSetChunk();//sqlite3DbMallocRaw(p.db, sizeof(*pNew));
     if ( pNew == null )
     {
       return;
     }
     pNew.pNextChunk = p.pChunk;
     p.pChunk = pNew;
     p.pFresh = pNew.aEntry;
     p.nFresh = ROWSET_ENTRY_PER_CHUNK;
       }
       p.pFresh[p.pFresh.Length - p.nFresh] = new RowSetEntry();
       pEntry = p.pFresh[p.pFresh.Length - p.nFresh];
       p.nFresh--;
       pEntry.v = rowid;
       pEntry.pRight = null;
       pLast = p.pLast;
       if ( pLast != null )
       {
     if ( p.isSorted && rowid <= pLast.v )
     {
       p.isSorted = false;
     }
     pLast.pRight = pEntry;
       }
       else
       {
     Debug.Assert( p.pEntry == null );/* Fires if INSERT after SMALLEST */
     p.pEntry = pEntry;
       }
       p.pLast = pEntry;
 }
开发者ID:taxilian,项目名称:some_library,代码行数:45,代码来源:rowset_c.cs


示例19: sqlite3RowSetInit

 /*
 ** Turn bulk memory into a RowSet object.  N bytes of memory
 ** are available at pSpace.  The db pointer is used as a memory context
 ** for any subsequent allocations that need to occur.
 ** Return a pointer to the new RowSet object.
 **
 ** It must be the case that N is sufficient to make a Rowset.  If not
 ** an assertion fault occurs.
 **
 ** If N is larger than the minimum, use the surplus as an initial
 ** allocation of entries available to be filled.
 */
 static RowSet sqlite3RowSetInit( sqlite3 db, object pSpace, u32 N )
 {
     RowSet p = new RowSet( db, (int)N );
       //Debug.Assert(N >= ROUND8(sizeof(*p)) );
       //  p = pSpace;
       //  p.pChunk = 0;
       //  p.db = db;
       //  p.pEntry = 0;
       //  p.pLast = 0;
       //  p.pTree = 0;
       //  p.pFresh =(struct RowSetEntry*)(ROUND8(sizeof(*p)) + (char*)p);
       //  p.nFresh = (u16)((N - ROUND8(sizeof(*p)))/sizeof(struct RowSetEntry));
       //  p.isSorted = 1;
       //  p.iBatch = 0;
       return p;
 }
开发者ID:taxilian,项目名称:some_library,代码行数:28,代码来源:rowset_c.cs


示例20: sqlite3RowSetClear

 /*
 ** Deallocate all chunks from a RowSet.  This frees all memory that
 ** the RowSet has allocated over its lifetime.  This routine is
 ** the destructor for the RowSet.
 */
 static void sqlite3RowSetClear( RowSet p )
 {
     RowSetChunk pChunk, pNextChunk;
       for ( pChunk = p.pChunk; pChunk != null; pChunk = pNextChunk )
       {
     pNextChunk = pChunk.pNextChunk;
     sqlite3DbFree( p.db, ref pChunk );
       }
       p.pChunk = null;
       p.nFresh = 0;
       p.pEntry = null;
       p.pLast = null;
       p.pTree = null;
       p.isSorted = true;
 }
开发者ID:taxilian,项目名称:some_library,代码行数:20,代码来源:rowset_c.cs



注:本文中的RowSet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Rows类代码示例发布时间:2022-05-24
下一篇:
C# RowIndicatorCustomDrawEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap