Show / Hide Table of Contents

Class TableEmitterBase

Helpful base class for defining "table emission" logic.

Inheritance
Object
LoggingTableVisitorBase
TableEmitterBase
ScopeTable
Implements
ITableVisitor
Inherited Members
LoggingTableVisitorBase.Logger
LoggingTableVisitorBase.VisitorName
LoggingTableVisitorBase.VisitWithTracing(Aggregation)
LoggingTableVisitorBase.VisitWithTracing(DataSource)
LoggingTableVisitorBase.VisitWithTracing(ExternTable)
LoggingTableVisitorBase.VisitWithTracing(Join)
LoggingTableVisitorBase.VisitWithTracing(TableReference)
LoggingTableVisitorBase.VisitWithTracing(Union)
LoggingTableVisitorBase.Visit(Aggregation)
LoggingTableVisitorBase.Visit(DataSource)
LoggingTableVisitorBase.Visit(ExternTable)
LoggingTableVisitorBase.Visit(Join)
LoggingTableVisitorBase.Visit(TableReference)
LoggingTableVisitorBase.Visit(Union)
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Mangrove.MetricSetEmitters
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
Type Name Description
ILogger logger
TextWriter output
IReadOnlyDictionary<Table, ISet<Expression>> tableToExpressionsMap

Properties

View Source

ExpressionVisitor

Use this to create strings out of Expression nodes.

Declaration
protected virtual IGenericExpressionVisitor<string> ExpressionVisitor { get; }
Property Value
Type Description
IGenericExpressionVisitor<String>
View Source

Output

Declaration
protected TextWriter Output { get; }
Property Value
Type Description
TextWriter
View Source

TableToExpressionsMap

Declaration
protected IReadOnlyDictionary<Table, ISet<Expression>> TableToExpressionsMap { get; }
Property Value
Type Description
IReadOnlyDictionary<Table, ISet<Expression>>

Methods

View Source

ColumnReferences(Table)

Declaration
protected IEnumerable<ColumnReference> ColumnReferences(Table table)
Parameters
Type Name Description
Table table
Returns
Type Description
IEnumerable<ColumnReference>
View Source

CreateExpressionVisitor(ILogger)

Declaration
protected abstract IGenericExpressionVisitor<string> CreateExpressionVisitor(ILogger logger)
Parameters
Type Name Description
ILogger logger
Returns
Type Description
IGenericExpressionVisitor<String>
View Source

Emit(Expression)

Use the visitor produced by CreateExpressionVisitor(ILogger) to transform an Expression into a string.

Declaration
protected string Emit(Expression e)
Parameters
Type Name Description
Expression e
Returns
Type Description
String
View Source

Emit(TokenOrExpression)

Declaration
protected string Emit(TokenOrExpression toe)
Parameters
Type Name Description
TokenOrExpression toe
Returns
Type Description
String
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
Type Description
IEnumerable<ColumnReference>
View Source

FilterStatement(Table)

Generate the "where clause" for a Table node using GenerateWhereClause(IEnumerable<String>, Table) regardless of whether or not there actually are any Filter conditions.

Declaration
protected string FilterStatement(Table table)
Parameters
Type Name Description
Table table
Returns
Type Description
String
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
Type Description
String
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
Type Name Description
IEnumerable<String> filters
Table table
Returns
Type Description
String

Implements

ITableVisitor

Extension Methods

ObjectExtensions.EventId(Object)
  • View Source
Back to top Generated by DocFX