You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.5 KiB
63 lines
1.5 KiB
// <file> |
|
// <copyright see="prj:///doc/copyright.txt"/> |
|
// <license see="prj:///doc/license.txt"/> |
|
// <owner name="Daniel Grunwald"/> |
|
// <version>$Revision$</version> |
|
// </file> |
|
|
|
using System; |
|
|
|
namespace ICSharpCode.Profiler.Controller.Data.Linq |
|
{ |
|
sealed class SqlQueryContext |
|
{ |
|
public readonly int StartDataSetID; |
|
|
|
public SqlQueryContext(SQLiteQueryProvider provider) |
|
{ |
|
this.StartDataSetID = provider.startDataSetID; |
|
} |
|
|
|
int uniqueVariableIndex; |
|
|
|
public string GenerateUniqueVariableName() |
|
{ |
|
return "v" + (++uniqueVariableIndex).ToString(); |
|
} |
|
|
|
public CallTreeNodeSqlNameSet CurrentNameSet; |
|
} |
|
|
|
sealed class CallTreeNodeSqlNameSet |
|
{ |
|
public readonly string ID; |
|
public readonly string NameID = "nameid"; |
|
public readonly string TimeSpent; |
|
public readonly string CallCount; |
|
public readonly string HasChildren; |
|
public readonly string ActiveCallCount; |
|
|
|
/// <summary> |
|
/// Gets whether this nameset represents non-merged calls. |
|
/// </summary> |
|
public readonly bool IsCalls; |
|
|
|
public CallTreeNodeSqlNameSet(SqlQueryContext c, bool isCalls) |
|
{ |
|
this.IsCalls = isCalls; |
|
|
|
string prefix = c.GenerateUniqueVariableName(); |
|
if (isCalls) { |
|
ID = "id"; |
|
TimeSpent = "timespent"; |
|
CallCount = "callcount"; |
|
} else { |
|
ID = prefix + "ID"; |
|
TimeSpent = prefix + "TimeSpent"; |
|
CallCount = prefix + "CallCount"; |
|
} |
|
HasChildren = prefix + "HasChildren"; |
|
ActiveCallCount = prefix + "ActiveCallCount"; |
|
} |
|
} |
|
}
|
|
|