1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using FLY.OBJComponents.Common;
using FObjBase;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FLY.OBJComponents.IService
{
/// <summary>
/// 使用窗口式显示
/// 每行数据都有 uint32 id.
/// 每多一行 id+1
/// id 最大值 为 uint32.MaxValue, 最小值 为 uint32.MinValue
/// </summary>
/// <typeparam name="T"></typeparam>
public interface IBuffer<T> : INotifyBufferChanged<T>, INotifyPropertyChanged
{
/// <summary>
/// 最新ID
/// </summary>
int NewestID { get; }
/// <summary>
/// 当前总数量
/// </summary>
int Count { get; }
/// <summary>
/// 总容量,当总数量 大于等于 总容量的 100%, 前面的10%数据会被删除
/// </summary>
int Capacity { get; set; }
/// <summary>
/// 清空全部数据
/// </summary>
void Reset();
/// <summary>
/// 获取指定位置的N个数据
/// </summary>
/// <param name="last_id">最后的ID</param>
/// <param name="count">数量</param>
/// <param name="asyncDelegate">回调</param>
/// <param name="asyncContext">回调里面的上下文</param>
void GetRecord(int last_id, int count, AsyncCBHandler asyncDelegate, object asyncContext);
/// <summary>
/// 获取最新的N个数据
/// </summary>
/// <param name="count">数量</param>
/// <param name="asyncDelegate">回调</param>
/// <param name="asyncContext">回调里面的上下文</param>
void GetRecord(int count, AsyncCBHandler asyncDelegate, object asyncContext);
}
public class GetRecordReponse<T>
{
public int LastID;
public IList<T> Items;
}
}