示例#1
0
        public List <T> Search(ref ICacheStorage_WuQi <K, T> container, int adapter, Hashtable al, out int getall)
        {
            List <T> result = new List <T>();

            getall = 0;//该策略没有缓存所有数据库数据,需要到数据库中查询。
            return(result);
        }
示例#2
0
        public List <T> Search(ref ICacheStorage_WuQi <K, T> container, int adapter, Hashtable al, out int getall)
        {
            getall = 0;//该策略无缓存,需要再到数据库中查询。
            List <T> result = new List <T>();

            return(result);
        }
示例#3
0
 public bool Insert(K k, CCacheItem_WuQi <K, T> item, ref ICacheStorage_WuQi <K, T> container)
 {
     if (!container.Contains(k))
     {
         container.Add(k, item);
     }
     return(true);
 }
示例#4
0
 public bool Delete(K k, ref ICacheStorage_WuQi <K, T> container)
 {
     if (container.Contains(k))
     {
         container.Remove(k);
     }
     return(true);
 }
示例#5
0
 public int SynchronousAllObject(List <CCacheItem_WuQi <K, T> > litem, ref ICacheStorage_WuQi <K, T> container)
 {
     container.Clear();
     foreach (CCacheItem_WuQi <K, T> item in litem)
     {
         container.Add(item.key, item);
     }
     return(container.Count);
 }
示例#6
0
 public CLogMsgContainer_WuQi(string conn, ICacheStorage_WuQi <uint, CLogMsg_WuQi> ics, ICacheDependency_WuQi <uint, CLogMsg_WuQi> icd)
     : base(ics, icd)
 {
     this.str_conn = conn;
     //首先清空数据库及缓存
     Clear();
     //获得数据库中做大的主键值
     SetMaxGuid();
 }
示例#7
0
 public int Delete(List <CCacheItem_WuQi <K, T> > listitem, ref ICacheStorage_WuQi <K, T> container)
 {
     foreach (CCacheItem_WuQi <K, T> item in listitem)
     {
         if (container.Contains(item.key))
         {
             container.Remove(item.key);
         }
     }
     return(listitem.Count);
 }
示例#8
0
        public int Insert(List <CCacheItem_WuQi <K, T> > listitem, ref ICacheStorage_WuQi <K, T> container)
        {
            int result = 0;

            foreach (CCacheItem_WuQi <K, T> item in listitem)
            {
                if (!container.Contains(item.key))
                {
                    container.Add(item.key, item);
                }
                result++;
            }
            return(result);
        }
示例#9
0
 public T SelectSingleObject(ref ICacheStorage_WuQi <K, T> container, K k, out int getall)
 {
     if (false != container.Contains(k))
     {
         getall = 1;//该数据已经查询到了,不在需要到数据库中查询了。
         CCacheItem_WuQi <K, T> item = container[k];
         //更新元素的访问数和最后访问时间
         item.hits++;
         item.d_lastaccesstime = DateTime.Now;
         return(item.t_value);
     }
     else
     {
         getall = 0;
     }
     return(default(T));
 }
示例#10
0
 /// <summary>
 /// 默认改造函数
 /// </summary>
 public ObjectContainer_WuQi(ICacheStorage_WuQi <K, T> ics, ICacheDependency_WuQi <K, T> icd)
 {
     this.obj_dependency = icd;
     this.obj_containers = ics;
     this.obj_rwl        = new System.Threading.ReaderWriterLock();
 }
示例#11
0
 public void Clear(ref ICacheStorage_WuQi <K, T> container)
 {
     return;
 }
示例#12
0
 public int Delete(List <CCacheItem_WuQi <K, T> > listitem, ref ICacheStorage_WuQi <K, T> container)
 {
     return(listitem.Count);
 }
示例#13
0
 public bool Delete(K k, ref ICacheStorage_WuQi <K, T> container)
 {
     return(true);
 }
示例#14
0
 public bool Insert(K k, CCacheItem_WuQi <K, T> item, ref ICacheStorage_WuQi <K, T> container)
 {
     return(true);
 }
示例#15
0
 public int SynchronousAllObject(List <CCacheItem_WuQi <K, T> > litem, ref ICacheStorage_WuQi <K, T> container)
 {
     container.Clear();
     return(container.Count);
 }
示例#16
0
 public T SelectSingleObject(ref ICacheStorage_WuQi <K, T> container, K k, out int getall)
 {
     getall = 0;//该策略无缓存,需要再到数据库中查询了。
     return(default(T));
 }
示例#17
0
 public void Clear(ref ICacheStorage_WuQi <K, T> container)
 {
     container.Clear();
 }