Beispiel #1
0
 /// <summary>
 /// 添加对象
 /// </summary>
 /// <param name="value">添加的对象</param>
 /// <param name="key"></param>
 /// <param name="logSize">日志字节长度</param>
 /// <param name="isCopy">是否浅复制缓存对象值,否则返回缓存对象</param>
 /// <returns>添加的对象</returns>
 protected override valueType insert(valueType value, keyType key, int logSize, bool isCopy)
 {
     if (isCopy)
     {
         value = value.Clone();
     }
     tree[key] = new cacheValue {
         Value = value, LogSize = logSize
     };
     return(value);
 }
Beispiel #2
0
 public void LoadInsert(valueType value, keyType key, int logSize)
 {
     tree[key] = new cacheValue {
         Value = value, LogSize = logSize
     };
 }
Beispiel #3
0
 /// <summary>
 /// 获取数据
 /// </summary>
 /// <param name="value"></param>
 private static valueType getValue(cacheValue value)
 {
     return(value.Value);
 }