Merge "Disable syslog in heat-translator for functest integration"
[parser.git] / verigraph / src / it / polito / verigraph / mcnet / components / Core.java
1 /*******************************************************************************
2  * Copyright (c) 2017 Politecnico di Torino and others.
3  *
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Apache License, Version 2.0
6  * which accompanies this distribution, and is available at
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *******************************************************************************/
9 package it.polito.verigraph.mcnet.components;
10
11 import com.microsoft.z3.Context;
12 import com.microsoft.z3.Solver;
13
14 /**Core component for everything that matters
15  *
16  *
17  */
18 public abstract class Core{
19
20     final int MAX_PORT = 512;
21
22     /**
23      * Base class for all objects in the modeling framework
24      * @param ctx
25      * @param args
26      */
27     public Core(Context ctx, Object[]... args){ // Object[]... -> The nearest way to implement variable length argument lists
28         //in Java, in the most generic way.
29         init(ctx,args);
30     }
31     /**
32      * Override _init for any constructor initialization. Avoids having to explicitly call super.__init__ every Time.class
33      * @param ctx
34      * @param args
35      */
36     abstract protected void init(Context ctx,Object[]... args);
37
38     /**
39      * Add constraints to solver
40      * @param solver
41      */
42     abstract protected void addConstraints(Solver solver);
43 }