Skip to content

Commit f434ac9

Browse files
committed
Declare CacheBase methods as abstract; Change file summary
1 parent b6b0253 commit f434ac9

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

Orm/Xtensive.Orm.Tests.Core/Caching/LruCacheTest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright (C) 2021 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
4+
15
using System;
26
using System.Threading;
37
using System.Threading.Tasks;

Orm/Xtensive.Orm/Caching/CacheBase.cs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,21 @@ public abstract class CacheBase<TKey, TItem> : ICache<TKey, TItem>
1919
public virtual TItem this[TKey key, bool markAsHit] => TryGetItem(key, markAsHit, out var item) ? item : default;
2020

2121
/// <inheritdoc/>
22-
public virtual int Count => throw new NotImplementedException();
22+
public abstract int Count { get; }
2323

24-
public virtual TItem Add(TItem item, bool replaceIfExists) => throw new NotImplementedException();
24+
/// <inheritdoc/>
25+
public abstract TItem Add(TItem item, bool replaceIfExists);
2526

2627
/// <inheritdoc/>
2728
public virtual void Add(TItem item) => Add(item, true);
2829

30+
/// <inheritdoc/>
2931
public virtual void Clear() => throw new NotImplementedException();
32+
33+
/// <inheritdoc/>
3034
public virtual bool ContainsKey(TKey key) => throw new NotImplementedException();
35+
36+
/// <inheritdoc/>
3137
public virtual IEnumerator<TItem> GetEnumerator() => throw new NotImplementedException();
3238

3339
/// <inheritdoc/>
@@ -37,9 +43,14 @@ public virtual void Remove(TItem item)
3743
RemoveKey(KeyExtractor(item));
3844
}
3945

40-
public virtual void RemoveKey(TKey key) => throw new NotImplementedException();
41-
public virtual void RemoveKey(TKey key, bool removeCompletely) => throw new NotImplementedException();
42-
public virtual bool TryGetItem(TKey key, bool markAsHit, out TItem item) => throw new NotImplementedException();
46+
/// <inheritdoc/>
47+
public abstract void RemoveKey(TKey key);
48+
49+
/// <inheritdoc/>
50+
public abstract void RemoveKey(TKey key, bool removeCompletely);
51+
52+
/// <inheritdoc/>
53+
public abstract bool TryGetItem(TKey key, bool markAsHit, out TItem item);
4354
}
4455
}
4556

Orm/Xtensive.Orm/Caching/FastConcurrentLruCache{TKey, TItem}.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
4-
// Created by: Alex Ustinov
5-
// Created: 2007.05.28
1+
// Copyright (C) 2021 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
64

75
using System;
86
using System.Collections;

0 commit comments

Comments
 (0)