Class TableEmitterBase
Helpful base class for defining "table emission" logic.
Inheritance
TableEmitterBase
Assembly: MetricSetEmitters.dll
Syntax
public abstract class TableEmitterBase : LoggingTableVisitorBase, ITableVisitor
Constructors
View Source
TableEmitterBase(ILogger, TextWriter, IReadOnlyDictionary<Table, ISet<Expression>>)
Standard constructor consuming logging, output, and Table -> Expression
information.
Declaration
public TableEmitterBase(ILogger logger, TextWriter output, IReadOnlyDictionary<Table, ISet<Expression>> tableToExpressionsMap)
Parameters
Properties
View Source
ExpressionVisitor
Use this to create strings out of Expression nodes.
Declaration
protected virtual IGenericExpressionVisitor<string> ExpressionVisitor { get; }
Property Value
View Source
Output
Declaration
protected TextWriter Output { get; }
Property Value
View Source
TableToExpressionsMap
Declaration
protected IReadOnlyDictionary<Table, ISet<Expression>> TableToExpressionsMap { get; }
Property Value
Methods
View Source
ColumnReferences(Table)
Declaration
protected IEnumerable<ColumnReference> ColumnReferences(Table table)
Parameters
Type |
Name |
Description |
Table |
table |
|
Returns
View Source
CreateExpressionVisitor(ILogger)
Declaration
protected abstract IGenericExpressionVisitor<string> CreateExpressionVisitor(ILogger logger)
Parameters
Type |
Name |
Description |
ILogger |
logger |
|
Returns
View Source
Emit(Expression)
Declaration
protected string Emit(Expression e)
Parameters
Returns
View Source
Emit(TokenOrExpression)
Declaration
protected string Emit(TokenOrExpression toe)
Parameters
Returns
View Source
ExtensionExpressions(Table)
Identify aggregands which wrap literal expressions, and are thus "dummy".
Declaration
protected IEnumerable<ColumnReference> ExtensionExpressions(Table table)
Parameters
Type |
Name |
Description |
Table |
table |
|
Returns
View Source
FilterStatement(Table)
Declaration
protected string FilterStatement(Table table)
Parameters
Type |
Name |
Description |
Table |
table |
|
Returns
View Source
FilterString(Filter)
Why is this needed? In most SQL-like query languages (e.g., Scope) you cannot both
define a column and use it as a filter in the same SELECT
statement, you
instead have to "inline" the definition in the WHERE
clause. This method
encodes that logic.
Declaration
protected string FilterString(Filter f)
Parameters
Type |
Name |
Description |
Filter |
f |
|
Returns
View Source
GenerateWhereClause(IEnumerable<String>, Table)
Generate the "WHERE" clause for a collection of filter statements. The implementation
may assume that filters
is non-empty.
Declaration
protected abstract string GenerateWhereClause(IEnumerable<string> filters, Table table)
Parameters
Returns
Implements
Extension Methods