本文整理汇总了C#中Db4objects.Db4o.Internal.ObjectReference.GetID方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectReference.GetID方法的具体用法?C# ObjectReference.GetID怎么用?C# ObjectReference.GetID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db4objects.Db4o.Internal.ObjectReference
的用法示例。
在下文中一共展示了ObjectReference.GetID方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveReference
public override void RemoveReference(ObjectReference @ref)
{
if (_newReferences.ReferenceForId(@ref.GetID()) != null)
{
_newReferences.RemoveReference(@ref);
ReferenceCountChanged(-1);
}
if (_committedReferences.ReferenceForId(@ref.GetID()) != null)
{
_committedReferences.RemoveReference(@ref);
ReferenceCountChanged(-1);
}
}
示例2: FrozenObjectInfo
private FrozenObjectInfo(ObjectReference @ref, VirtualAttributes virtualAttributes
) : this(@ref == null ? null : @ref.GetObject(), @ref == null ? -1 : @ref.GetID(
), virtualAttributes == null ? null : virtualAttributes.i_database, virtualAttributes
== null ? -1 : virtualAttributes.i_uuid, virtualAttributes == null ? 0 : virtualAttributes
.i_version)
{
}
示例3: IdAdd
private void IdAdd(ObjectReference @ref)
{
if (DTrace.enabled)
{
DTrace.IdTreeAdd.Log(@ref.GetID());
}
if (_idTree == null)
{
_idTree = @ref;
return;
}
_idTree = _idTree.Id_add(@ref);
}
示例4: Delete4
public sealed override bool Delete4(Transaction ta, ObjectReference yo, object obj
, int a_cascade, bool userCall)
{
MsgD msg = Msg.Delete.GetWriterForInts(_transaction, new int[] { yo.GetID(), userCall
? 1 : 0 });
WriteBatchedMessage(msg);
return true;
}
示例5: Delete3
internal void Delete3(Transaction trans, ObjectReference @ref, object obj, int cascade
, bool userCall)
{
// The passed reference can be null, when calling from Transaction.
if (@ref == null || [email protected]())
{
return;
}
// This check is performed twice, here and in delete2, intentionally.
if (BreakDeleteForEnum(@ref, userCall))
{
@ref.EndProcessing();
return;
}
if ([email protected]())
{
@ref.EndProcessing();
return;
}
ClassMetadata yc = @ref.ClassMetadata();
// We have to end processing temporarily here, otherwise the can delete callback
// can't do anything at all with this object.
@ref.EndProcessing();
ActivateForDeletionCallback(trans, yc, @ref, obj);
if (!ObjectCanDelete(trans, yc, @ref))
{
return;
}
@ref.BeginProcessing();
if (DTrace.enabled)
{
DTrace.Delete.Log(@ref.GetID());
}
if (Delete4(trans, @ref, obj, cascade, userCall))
{
ObjectOnDelete(trans, yc, @ref);
if (ConfigImpl.MessageLevel() > Const4.State)
{
Message(string.Empty + @ref.GetID() + " delete " + @ref.ClassMetadata().GetName()
);
}
}
@ref.EndProcessing();
}
示例6: Delete2
public void Delete2(Transaction trans, ObjectReference @ref, object obj, int cascade
, bool userCall)
{
// This check is performed twice, here and in delete3, intentionally.
if (BreakDeleteForEnum(@ref, userCall))
{
return;
}
if (obj is Entry)
{
if (!FlagForDelete(@ref))
{
return;
}
Delete3(trans, @ref, obj, cascade, userCall);
return;
}
trans.Delete(@ref, @ref.GetID(), cascade);
}
示例7: Bind2
public ObjectReference Bind2(Transaction trans, ObjectReference oldRef, object obj
)
{
int id = oldRef.GetID();
trans.RemoveReference(oldRef);
ObjectReference newRef = new ObjectReference(ClassMetadataForObject(obj), id);
newRef.SetObjectWeak(this, obj);
newRef.SetStateDirty();
trans.ReferenceSystem().AddExistingReference(newRef);
return newRef;
}
示例8: Store2
public int Store2(Transaction trans, object obj, IUpdateDepth updateDepth, bool checkJustSet
)
{
if (obj == null || (obj is ITransientClass))
{
return 0;
}
ObjectAnalyzer analyzer = new ObjectAnalyzer(this, obj);
analyzer.Analyze(trans);
if (analyzer.NotStorable())
{
return 0;
}
ObjectReference @ref = analyzer.ObjectReference();
if (@ref == null)
{
ClassMetadata classMetadata = analyzer.ClassMetadata();
if (!ObjectCanNew(trans, classMetadata, obj))
{
return 0;
}
@ref = new ObjectReference();
@ref.Store(trans, classMetadata, obj);
trans.AddNewReference(@ref);
if (obj is IDb4oTypeImpl)
{
((IDb4oTypeImpl)obj).SetTrans(trans);
}
if (ConfigImpl.MessageLevel() > Const4.State)
{
Message(string.Empty + @ref.GetID() + " new " + @ref.ClassMetadata().GetName());
}
FlagAsHandled(@ref);
StillToSet(trans, @ref, updateDepth);
}
else
{
if (@ref.IsFlaggedAsHandled(_topLevelCallId))
{
AssertNotInCallback();
}
if (CanUpdate())
{
if (checkJustSet)
{
if (([email protected]()) && HandledInCurrentTopLevelCall(@ref))
{
return @ref.GetID();
}
}
if (updateDepth.SufficientDepth())
{
FlagAsHandled(@ref);
@ref.WriteUpdate(trans, updateDepth);
}
}
}
ProcessPendingClassUpdates();
return @ref.GetID();
}
示例9: ReadVirtualAttributes
public virtual void ReadVirtualAttributes(Transaction trans, ObjectReference @ref
, bool lastCommitted)
{
var id = @ref.GetID();
var container = trans.Container();
var buffer = container.ReadBufferById(trans, id, lastCommitted);
var oh = new ObjectHeader(this, buffer);
var context = new ObjectReferenceContext(trans, buffer, oh, @ref
);
Handlers4.FieldAwareTypeHandler(CorrectHandlerVersion(context)).ReadVirtualAttributes
(context);
}
示例10: RemoveReference
public virtual void RemoveReference(ObjectReference @ref)
{
if (DTrace.enabled)
{
DTrace.ReferenceRemoved.Log(@ref.GetID());
}
if (_hashCodeTree != null)
{
_hashCodeTree = _hashCodeTree.Hc_remove(@ref);
}
if (_idTree != null)
{
_idTree = _idTree.Id_remove(@ref);
}
}
示例11: Delete4
public sealed override bool Delete4(Transaction transaction, ObjectReference @ref
, object obj, int cascade, bool userCall)
{
int id = @ref.GetID();
StatefulBuffer reader = ReadStatefulBufferById(transaction, id);
if (reader != null)
{
if (obj != null)
{
if ((!ShowInternalClasses()) && Const4.ClassInternal.IsAssignableFrom(obj.GetType
()))
{
return false;
}
}
reader.SetCascadeDeletes(cascade);
transaction.IdSystem().NotifySlotDeleted(id, SlotChangeFactory.UserObjects);
ClassMetadata classMetadata = @ref.ClassMetadata();
classMetadata.Delete(reader, obj);
return true;
}
return false;
}
示例12: Marshall
internal override void Marshall(Transaction trans, ObjectReference @ref, IWriteBuffer
buffer, bool isMigrating, bool isNew)
{
var attr = @ref.VirtualAttributes();
var container = trans.Container();
var doAddIndexEntry = isNew && container.MaintainsIndices();
var dbID = 0;
var linkToDatabase = (attr != null && attr.i_database == null) ? true : !isMigrating;
if (linkToDatabase)
{
var db = ((IInternalObjectContainer) container).Identity();
if (db == null)
{
// can happen on early classes like Metaxxx, no problem
attr = null;
}
else
{
if (attr.i_database == null)
{
attr.i_database = db;
// TODO: Should be check for ! client instead of instanceof
if (container is LocalObjectContainer)
{
attr.i_uuid = container.GenerateTimeStampId();
doAddIndexEntry = true;
}
}
db = attr.i_database;
if (db != null)
{
dbID = db.GetID(trans);
}
}
}
else
{
if (attr != null)
{
dbID = attr.i_database.GetID(trans);
}
}
buffer.WriteInt(dbID);
if (attr == null)
{
buffer.WriteLong(0);
return;
}
buffer.WriteLong(attr.i_uuid);
if (doAddIndexEntry)
{
AddIndexEntry(trans, @ref.GetID(), attr.i_uuid);
}
}