internal PropertyTypeNoDuplicateValues(bool isVertexProp, TypeId typeId, PropertyId propertyId, string name, PropertyKind kind, Graph graph) : base(isVertexProp, typeId, propertyId, name, kind, graph) { m_valueToId = new BTreeMap <T, UInt64>(null, graph.GetSession()); m_IdToValue = new BTreeMap <UInt64, T>(null, graph.GetSession()); m_nextId = 0; }
internal PropertyTypeT(bool isVertexProp, TypeId typeId, PropertyId propertyId, string name, PropertyKind kind, Graph graph) : base(isVertexProp, typeId, propertyId, name, graph) { m_propertyValue = new BTreeMap <ElementId, T>(null, graph.GetSession()); switch (kind) { case PropertyKind.Indexed: m_valueIndex = new BTreeMap <T, BTreeSet <ElementId> >(null, graph.GetSession()); break; case PropertyKind.Unique: m_valueIndexUnique = new BTreeMap <T, ElementId>(null, graph.GetSession()); break; } }
/// <summary> /// Creates a new edge type. /// </summary> /// <param name="aTypeId">The id to use for the new edge type</param> /// <param name="aTypeName">A type name to use</param> /// <param name="tailType">Restrict tail vertex to a certain vertex type</param> /// <param name="headType">Restrict head vertex to a certain vertex type</param> /// <param name="birectional">Is this edge type bidirectional (going both ways)</param> /// <param name="baseType">A base type can be specified</param> /// <param name="graph">The owning graph</param> public EdgeType(TypeId aTypeId, string aTypeName, VertexType tailType, VertexType headType, bool birectional, EdgeType baseType, Graph graph) { m_graph = new WeakIOptimizedPersistableReference <Graph>(graph); m_baseType = baseType; m_subTypes = new List <EdgeType>(); if (baseType != null) { baseType.Update(); baseType.m_subTypes.Add(this); } m_birectional = birectional; m_typeId = aTypeId; m_typeName = aTypeName; if (tailType != null) { m_tailType = new WeakIOptimizedPersistableReference <VertexType>(tailType); } if (headType != null) { m_headType = new WeakIOptimizedPersistableReference <VertexType>(headType); } if (Unrestricted) { m_unrestrictedEdges = new BTreeMap <EdgeId, UnrestrictedEdge>(null, graph.GetSession()); } else { m_restrictedEdges = new BTreeMap <EdgeId, ulong>(null, graph.GetSession()); } m_stringToPropertyType = new BTreeMap <string, PropertyType>(null, graph.GetSession()); var edgeRanges = new VelocityDbList <Range <EdgeId> >(); graph.GetSession().Persist(edgeRanges); m_edgeRanges = new WeakIOptimizedPersistableReference <VelocityDbList <Range <PropertyId> > >(edgeRanges); graph.GetSession().Persist(this); }