Show / Hide Table of Contents

Class ThreadSafeGraphCollection

Thread Safe decorator around a Graph collection.
Inheritance
System.Object
BaseGraphCollection
WrapperGraphCollection
ThreadSafeGraphCollection
Implements
System.Collections.Generic.IEnumerable<IGraph>
System.Collections.IEnumerable
System.IDisposable
Inherited Members
WrapperGraphCollection._graphs
BaseGraphCollection.IEnumerable.GetEnumerator()
BaseGraphCollection.GraphAdded
BaseGraphCollection.GraphRemoved
BaseGraphCollection.RaiseGraphAdded(IGraph)
BaseGraphCollection.RaiseGraphRemoved(IGraph)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRDF.dll
Syntax
public class ThreadSafeGraphCollection : WrapperGraphCollection, IEnumerable<IGraph>, IEnumerable, IDisposable
Remarks
Dependings on your platform this either provides MRSW concurrency via a System.Threading.ReaderWriterLockSlim or exclusive access concurrency via a System.Threading.Monitor.

Constructors

| Improve this Doc View Source

ThreadSafeGraphCollection()

Creates a new Thread Safe decorator around the default GraphCollection.
Declaration
public ThreadSafeGraphCollection()
| Improve this Doc View Source

ThreadSafeGraphCollection(BaseGraphCollection)

Creates a new Thread Safe decorator around the supplied graph collection.
Declaration
public ThreadSafeGraphCollection(BaseGraphCollection graphCollection)
Parameters
Type Name Description
BaseGraphCollection graphCollection Graph Collection.

Properties

| Improve this Doc View Source

Count

Gets the number of Graphs in the Collection.
Declaration
public override int Count { get; }
Property Value
Type Description
System.Int32
Overrides
WrapperGraphCollection.Count
| Improve this Doc View Source

GraphUris

Provides access to the Graph URIs of Graphs in the Collection.
Declaration
public override IEnumerable<Uri> GraphUris { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Uri>
Overrides
WrapperGraphCollection.GraphUris
| Improve this Doc View Source

Item[Uri]

Gets a Graph from the Collection.
Declaration
public override IGraph this[Uri graphUri] { get; }
Parameters
Type Name Description
System.Uri graphUri Graph Uri.
Property Value
Type Description
IGraph
Overrides
WrapperGraphCollection.Item[Uri]

Methods

| Improve this Doc View Source

Add(IGraph, Boolean)

Adds a Graph to the Collection.
Declaration
protected override bool Add(IGraph g, bool mergeIfExists)
Parameters
Type Name Description
IGraph g Graph to add.
System.Boolean mergeIfExists Sets whether the Graph should be merged with an existing Graph of the same Uri if present.
Returns
Type Description
System.Boolean
Overrides
WrapperGraphCollection.Add(IGraph, Boolean)
Exceptions
Type Condition
RdfException Throws an RDF Exception if the Graph has no Base Uri or if the Graph already exists in the Collection and the mergeIfExists parameter was not set to true.
| Improve this Doc View Source

Contains(Uri)

Checks whether the Graph with the given Uri exists in this Graph Collection.
Declaration
public override bool Contains(Uri graphUri)
Parameters
Type Name Description
System.Uri graphUri Graph Uri to test.
Returns
Type Description
System.Boolean
Overrides
WrapperGraphCollection.Contains(Uri)
| Improve this Doc View Source

Dispose()

Disposes of the Graph Collection.
Declaration
public override void Dispose()
Overrides
WrapperGraphCollection.Dispose()
Remarks
Invokes the Dispose() method of all Graphs contained in the Collection.
| Improve this Doc View Source

EnterReadLock()

Enters the read lock.
Declaration
protected void EnterReadLock()
| Improve this Doc View Source

EnterWriteLock()

Enters the write lock.
Declaration
protected void EnterWriteLock()
| Improve this Doc View Source

ExitReadLock()

Exits the read lock.
Declaration
protected void ExitReadLock()
| Improve this Doc View Source

ExitWriteLock()

Exits the write lock.
Declaration
protected void ExitWriteLock()
| Improve this Doc View Source

GetEnumerator()

Gets the Enumerator for the Collection.
Declaration
public override IEnumerator<IGraph> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<IGraph>
Overrides
WrapperGraphCollection.GetEnumerator()
| Improve this Doc View Source

Remove(Uri)

Removes a Graph from the Collection.
Declaration
protected override bool Remove(Uri graphUri)
Parameters
Type Name Description
System.Uri graphUri Uri of the Graph to remove.
Returns
Type Description
System.Boolean
Overrides
WrapperGraphCollection.Remove(Uri)

Implements

System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
System.IDisposable

Extension Methods

Extensions.AsEnumerable<T>(T)
Extensions.IsDisjoint<T>(IEnumerable<T>, IEnumerable<T>)
Extensions.ChunkBy<T>(IEnumerable<T>, Int32)
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • ThreadSafeGraphCollection()
    • ThreadSafeGraphCollection(BaseGraphCollection)
  • Properties
    • Count
    • GraphUris
    • Item[Uri]
  • Methods
    • Add(IGraph, Boolean)
    • Contains(Uri)
    • Dispose()
    • EnterReadLock()
    • EnterWriteLock()
    • ExitReadLock()
    • ExitWriteLock()
    • GetEnumerator()
    • Remove(Uri)
  • Implements
  • Extension Methods
Back to top Generated by DocFX