Beispiel #1
0
        /// <summary>
        ///     Adds custom ID functionality to the given graph,
        ///     supporting either custom vertex IDs, custom edge IDs, or both.
        /// </summary>
        /// <param name="baseGraph">the base graph which does not necessarily support custom IDs</param>
        /// <param name="supportVertexIds">whether to support custom vertex IDs</param>
        /// <param name="supportEdgeIds">whether to support custom edge IDs</param>
        public IdGraph(IKeyIndexableGraph baseGraph, bool supportVertexIds, bool supportEdgeIds)
        {
            if (baseGraph == null)
            {
                throw new ArgumentNullException(nameof(baseGraph));
            }

            if (!(supportVertexIds || supportEdgeIds))
            {
                throw new ArgumentException("Edge or Vertex Ids support must be on");
            }

            _baseGraph                   = baseGraph;
            _features                    = _baseGraph.Features.CopyFeatures();
            _features.IsWrapper          = true;
            _features.IgnoresSuppliedIds = false;

            _supportVertexIds = supportVertexIds;
            _supportEdgeIds   = supportEdgeIds;

            CreateIndices();

            _vertexIdFactory = new DefaultIdFactory();
            _edgeIdFactory   = new DefaultIdFactory();
        }
 public ReadOnlyKeyIndexableGraph(IKeyIndexableGraph baseGraph)
     : base((IIndexableGraph)baseGraph)
 {
     if (baseGraph == null)
     {
         throw new ArgumentNullException(nameof(baseGraph));
     }
 }
Beispiel #3
0
 /// <summary>
 ///     Adds custom ID functionality to the given graph,
 ///     supporting both custom vertex IDs and custom edge IDs.
 /// </summary>
 /// <param name="baseGraph">the base graph which does not necessarily support custom IDs</param>
 public IdGraph(IKeyIndexableGraph baseGraph)
     : this(baseGraph, true, true)
 {
     if (baseGraph == null)
     {
         throw new ArgumentNullException(nameof(baseGraph));
     }
 }