/*
 * Various objects that represent cubey type stuff
 */
namespace ms.aq.cview.util {
    public enum VDType {
        SHALLOW = 0,
        DEEP = 1,
        MEASURE = 2
    }
    public enum VHType {
        SHALLOW = 0,
        DEEP = 1
    }
    public abstract class VObject {
        public string UID;
        public string Name;
    }
    public class VDimension : VObject {
        public VDType Type;
        public string Relations, PKey;
        public VDimension(string name, VDType vdt, string relations, string pkeyh) {
            Name = name;
            UID = "[" + name + "]";
            Type = vdt;
            Relations = relations;
            PKey = pkeyh;
        }
    }
    public class VHierarchy : VObject {
        public VHType Type;
        public VDimension ParentDimension;
        public string TableMap;
        public VHierarchy(string name, VDimension pd, string tm, VHType vht) {
            Name = name;
            ParentDimension = pd;
            TableMap = tm;
            Type = vht;
            UID = pd.UID + ".[" + name + "]";
        }
    }
    public class VMember : VObject {
        //hierachy or level will be null, depending on context
        public VHierarchy ParentHierachy;
        public VLevel ParentLevel;

        public VMember(string name, VHierarchy ph, VLevel pl) {
            Name = name;
            ParentHierachy = ph;
            ParentLevel = pl;
            UID = ph != null ? ph.UID + ".[" + name + "]" : pl.UID + ".[" + name + "]";
        }
    }
    public class VLevel : VObject {
        public string Prefix;
        public int LevelNum;
        public string ColumnMap;
        public VHierarchy ParentHierarchy;
        public VLevel(string name, int levelnum, string prefix, string columnmap,
           VHierarchy ph) {
            Name = name;
            LevelNum = levelnum;
            Prefix = prefix;
            ColumnMap = columnmap;
            ParentHierarchy = ph;
            UID = ph.UID + ".[" + name + "]";
        }
    }
}