Commit f6200228 authored by Lucas Fernandes de Oliveira's avatar Lucas Fernandes de Oliveira
Browse files

Merge branch 'issue/14' into 'master'

Issue #14: Convert Engine class to Singletion pattern

See merge request !10
parents 89bc66a8 18ed93c1
Pipeline #9856 passed with stage
in 40 seconds
......@@ -27,7 +27,7 @@ import { View } from "./view";
import { engineScenario } from "../../test/scenario";
describe("engine class", () => {
const engine = new Engine();
const engine = Engine.getInstance();
const met = engineScenario.metrics;
const dim = engineScenario.dimensions;
......
......@@ -25,11 +25,21 @@ import { Query } from "../common/query";
import { RelationType } from "../common/types";
export class Engine {
private static instance: Engine;
private views: View[] = [];
private metrics: Metric[] = [];
private dimensions: Dimension[] = [];
constructor () { }
private constructor () { }
public static getInstance(): Engine {
if (this.instance == null) {
this.instance = new Engine();
}
return this.instance;
}
public getViews() {
return this.views;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment