⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 persistentstub.cs

📁 Perst开源实时数据库
💻 CS
字号:
namespace Perst.Impl
{
    using Perst;

    public class PersistentStub : IPersistent 
    { 
        public virtual int Oid
        {
            get
            {
                return oid;
            }	
        }

        public virtual Storage Storage
        {
            get
            {
                return storage;
            }			
        }

        public virtual void Load()
        {
            throw new StorageError(StorageError.ErrorCode.ACCESS_TO_STUB);
        }
		
        public bool IsRaw() 
        { 
            return true;
        } 
    
        public bool IsModified() 
        { 
            return false;
        } 
 
    
        public bool IsDeleted() 
        { 
            return false;
        } 

        public bool IsPersistent()
        {
            return true;
        }
		
        public virtual int MakePersistent(Storage storage)
        {
            throw new StorageError(StorageError.ErrorCode.ACCESS_TO_STUB);
        }
		
        public virtual void Store()
        {
            throw new StorageError(StorageError.ErrorCode.ACCESS_TO_STUB);
        }
		
        public void Modify() 
        { 
            throw new StorageError(StorageError.ErrorCode.ACCESS_TO_STUB);
        }

        public virtual void Deallocate()
        {
            throw new StorageError(StorageError.ErrorCode.ACCESS_TO_STUB);
        }
		
        public virtual bool RecursiveLoading()
        {
            return true;
        }
		
		
        public override bool Equals(object o)
        {
            return o is IPersistent && ((IPersistent) o).Oid == oid;
        }
		
        public override int GetHashCode()
        {
            return oid;
        }
		
        public virtual void OnLoad() 
        {
        }
        
        public virtual void OnStore() 
        {
        }
        
        public virtual void Invalidate() 
        {
            throw new StorageError(StorageError.ErrorCode.ACCESS_TO_STUB);
        }
        
        internal PersistentStub(Storage storage, int oid) 
        {
            this.storage = storage;
            this.oid = oid;
        } 

        public void AssignOid(Storage storage, int oid, bool raw)
        {
            throw new StorageError(StorageError.ErrorCode.ACCESS_TO_STUB);
        }


        private Storage storage;
        private int oid;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -