persistentstub.cs
来自「Perst开源实时数据库」· CS 代码 · 共 114 行
CS
114 行
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 + =
减小字号Ctrl + -
显示快捷键?