Fantasy
搜索结果

    显示/隐藏目录

    ConcurrentOneToManyQueue<TKey, TValue> 类

    表示一个并发的一对多队列,用于维护具有相同键的多个值的关联关系。

    继承
    object
    ConcurrentDictionary<TKey, Queue<TValue>>
    ConcurrentOneToManyQueue<TKey, TValue>
    ConcurrentOneToManyQueuePool<TKey, TValue>
    实现
    IDictionary<TKey, Queue<TValue>>
    ICollection<KeyValuePair<TKey, Queue<TValue>>>
    IReadOnlyDictionary<TKey, Queue<TValue>>
    IReadOnlyCollection<KeyValuePair<TKey, Queue<TValue>>>
    IEnumerable<KeyValuePair<TKey, Queue<TValue>>>
    IDictionary
    ICollection
    IEnumerable
    继承成员
    ConcurrentDictionary<TKey, Queue<TValue>>.AddOrUpdate(TKey, Func<TKey, Queue<TValue>>, Func<TKey, Queue<TValue>, Queue<TValue>>)
    ConcurrentDictionary<TKey, Queue<TValue>>.AddOrUpdate(TKey, Queue<TValue>, Func<TKey, Queue<TValue>, Queue<TValue>>)
    ConcurrentDictionary<TKey, Queue<TValue>>.AddOrUpdate<TArg>(TKey, Func<TKey, TArg, Queue<TValue>>, Func<TKey, Queue<TValue>, TArg, Queue<TValue>>, TArg)
    ConcurrentDictionary<TKey, Queue<TValue>>.Clear()
    ConcurrentDictionary<TKey, Queue<TValue>>.ContainsKey(TKey)
    ConcurrentDictionary<TKey, Queue<TValue>>.GetEnumerator()
    ConcurrentDictionary<TKey, Queue<TValue>>.GetOrAdd(TKey, Func<TKey, Queue<TValue>>)
    ConcurrentDictionary<TKey, Queue<TValue>>.GetOrAdd(TKey, Queue<TValue>)
    ConcurrentDictionary<TKey, Queue<TValue>>.GetOrAdd<TArg>(TKey, Func<TKey, TArg, Queue<TValue>>, TArg)
    ConcurrentDictionary<TKey, Queue<TValue>>.ToArray()
    ConcurrentDictionary<TKey, Queue<TValue>>.TryAdd(TKey, Queue<TValue>)
    ConcurrentDictionary<TKey, Queue<TValue>>.TryGetValue(TKey, out Queue<TValue>)
    ConcurrentDictionary<TKey, Queue<TValue>>.TryRemove(KeyValuePair<TKey, Queue<TValue>>)
    ConcurrentDictionary<TKey, Queue<TValue>>.TryRemove(TKey, out Queue<TValue>)
    ConcurrentDictionary<TKey, Queue<TValue>>.TryUpdate(TKey, Queue<TValue>, Queue<TValue>)
    ConcurrentDictionary<TKey, Queue<TValue>>.Comparer
    ConcurrentDictionary<TKey, Queue<TValue>>.Count
    ConcurrentDictionary<TKey, Queue<TValue>>.IsEmpty
    ConcurrentDictionary<TKey, Queue<TValue>>.this[TKey]
    ConcurrentDictionary<TKey, Queue<TValue>>.Keys
    ConcurrentDictionary<TKey, Queue<TValue>>.Values
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    命名空间: Fantasy.DataStructure.Collection
    程序集: Fantasy.Net.dll
    语法
    public class ConcurrentOneToManyQueue<TKey, TValue> : ConcurrentDictionary<TKey, Queue<TValue>>, IDictionary<TKey, Queue<TValue>>, ICollection<KeyValuePair<TKey, Queue<TValue>>>, IReadOnlyDictionary<TKey, Queue<TValue>>, IReadOnlyCollection<KeyValuePair<TKey, Queue<TValue>>>, IEnumerable<KeyValuePair<TKey, Queue<TValue>>>, IDictionary, ICollection, IEnumerable where TKey : notnull
    类型参数
    名称 描述
    TKey

    关键字的类型,不能为空。

    TValue

    值的类型。

    构造函数

    | 编辑本文 查看源代码

    ConcurrentOneToManyQueue(int)

    设置最大缓存数量

    声明
    public ConcurrentOneToManyQueue(int recyclingLimit = 0)
    参数
    类型 名称 描述
    int recyclingLimit

    1:防止数据量过大、所以超过recyclingLimit的数据还是走GC. 2:设置成0不控制数量,全部缓存

    方法

    | 编辑本文 查看源代码

    Clear()

    清空当前类的数据,包括从基类继承的键值对字典中的数据以及自定义的队列池。

    声明
    protected void Clear()
    | 编辑本文 查看源代码

    Contains(TKey, TValue)

    判断指定键的队列是否包含指定值。

    声明
    public bool Contains(TKey key, TValue value)
    参数
    类型 名称 描述
    TKey key

    要搜索的键。

    TValue value

    要搜索的值。

    返回
    类型 描述
    bool

    如果队列包含值,则为 true;否则为 false。

    | 编辑本文 查看源代码

    Dequeue(TKey)

    从指定键的队列中出队并返回一个值。

    声明
    public TValue Dequeue(TKey key)
    参数
    类型 名称 描述
    TKey key

    要出队的键。

    返回
    类型 描述
    TValue

    出队的值,如果队列为空则为默认值。

    | 编辑本文 查看源代码

    Enqueue(TKey, TValue)

    向指定键的队列中添加一个值。

    声明
    public void Enqueue(TKey key, TValue value)
    参数
    类型 名称 描述
    TKey key

    要添加值的键。

    TValue value

    要添加的值。

    | 编辑本文 查看源代码

    RemoveKey(TKey)

    从字典中移除指定键以及其关联的队列。

    声明
    public void RemoveKey(TKey key)
    参数
    类型 名称 描述
    TKey key

    要移除的键。

    | 编辑本文 查看源代码

    TryDequeue(TKey, out TValue)

    尝试从指定键的队列中出队一个值。

    声明
    public bool TryDequeue(TKey key, out TValue value)
    参数
    类型 名称 描述
    TKey key

    要出队的键。

    TValue value

    出队的值,如果队列为空则为默认值。

    返回
    类型 描述
    bool

    如果成功出队,则为 true;否则为 false。

    实现

    IDictionary<TKey, TValue>
    ICollection<T>
    IReadOnlyDictionary<TKey, TValue>
    IReadOnlyCollection<T>
    IEnumerable<T>
    IDictionary
    ICollection
    IEnumerable

    扩展方法

    JsonHelper.ToJson<T>(T)
    DictionaryExtensions.TryRemove<T, TV>(IDictionary<T, TV>, T, out TV)
    • 编辑本文
    • 查看源代码
    本文内容
    Back to top Generated by DocFX