本文整理汇总了C#中Db4objects.Db4o.Internal.ObjectReference类的典型用法代码示例。如果您正苦于以下问题:C# ObjectReference类的具体用法?C# ObjectReference怎么用?C# ObjectReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectReference类属于Db4objects.Db4o.Internal命名空间,在下文中一共展示了ObjectReference类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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)
{
}
示例2: FrozenObjectInfo
public FrozenObjectInfo(Transaction trans, ObjectReference @ref, bool committed) :
this(@ref, IsInstantiatedReference(@ref)
? @ref.VirtualAttributes(trans, committed
)
: null)
{
}
示例3: UnmarshallingContext
public UnmarshallingContext(Transaction transaction, ByteArrayBuffer buffer, ObjectReference
@ref, int addToIDTree, bool checkIDTree) : base(transaction, buffer, null, @ref
)
{
_addToIDTree = addToIDTree;
_checkIDTree = checkIDTree;
}
示例4: HashCodeAdd
// do nothing
private void HashCodeAdd(ObjectReference @ref)
{
if (_hashCodeTree == null)
{
_hashCodeTree = @ref;
return;
}
_hashCodeTree = _hashCodeTree.Hc_add(@ref);
}
示例5: Delete
public override bool Delete(ObjectReference @ref, int id, int cascade)
{
if (!base.Delete(@ref, id, cascade))
{
return false;
}
MsgD msg = Msg.TaDelete.GetWriterForInts(this, new int[] { id, cascade });
_client.WriteBatchedMessage(msg);
return true;
}
示例6: CreateReferences
private static object[] CreateReferences()
{
object[] references = new object[Ids.Length];
for (int i = 0; i < Ids.Length; i++)
{
ObjectReference @ref = new ObjectReference(Ids[i]);
@ref.SetObject(Ids[i].ToString());
references[i] = @ref;
}
return references;
}
示例7: 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);
}
}
示例8: 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);
}
示例9: MarshallingContext
public MarshallingContext(Db4objects.Db4o.Internal.Transaction trans, ObjectReference
@ref, IUpdateDepth updateDepth, bool isNew)
{
// YapClass ID
// Marshaller Version
// number of fields
_transaction = trans;
_reference = @ref;
_nullBitMap = new BitMap4(AspectCount());
_updateDepth = ClassMetadata().AdjustUpdateDepth(trans, updateDepth);
_isNew = isNew;
_writeBuffer = new MarshallingBuffer();
_currentBuffer = _writeBuffer;
}
示例10: PrefetchObjects
public virtual int PrefetchObjects(ClientObjectContainer container, Transaction trans
, IIntIterator4 ids, object[] prefetched, int prefetchCount)
{
int count = 0;
IList idsToGet = new ArrayList();
while (count < prefetchCount)
{
if (!ids.MoveNext())
{
break;
}
int id = ids.CurrentInt();
if (id > 0)
{
object obj = trans.ObjectForIdFromCache(id);
if (obj != null)
{
prefetched[count] = obj;
}
else
{
idsToGet.Add(Pair.Of(id, count));
}
count++;
}
}
if (idsToGet.Count > 0)
{
ByteArrayBuffer[] buffers = container.ReadObjectSlots(trans, IdArrayFor(idsToGet)
);
for (int i = 0; i < buffers.Length; i++)
{
Pair pair = ((Pair)idsToGet[i]);
int id = (((int)pair.first));
int position = (((int)pair.second));
object obj = trans.ObjectForIdFromCache(id);
if (obj != null)
{
prefetched[position] = obj;
}
else
{
prefetched[position] = new ObjectReference(id).ReadPrefetch(trans, buffers[i], Const4
.AddToIdTree);
}
}
}
return count;
}
示例11: Marshall
internal override void Marshall(Transaction trans, ObjectReference @ref, IWriteBuffer
buffer, bool isMigrating, bool isNew)
{
VirtualAttributes attr = @ref.VirtualAttributes();
if (!isMigrating)
{
attr.i_version = trans.Container().GenerateTimeStampId();
}
if (attr == null)
{
buffer.WriteLong(0);
}
else
{
buffer.WriteLong(attr.i_version);
}
}
示例12: WriteAndRead
private object WriteAndRead(object obj)
{
var imaginativeID = 500;
var @ref = new ObjectReference(ClassMetadataForObject(obj), imaginativeID
);
@ref.SetObject(obj);
var marshallingContext = new MarshallingContext(Trans(), @ref, Container
().UpdateDepthProvider().ForDepth(int.MaxValue), true);
Handlers4.Write(@ref.ClassMetadata().TypeHandler(), marshallingContext, obj);
var pointer = marshallingContext.AllocateSlot();
var buffer = marshallingContext.ToWriteBuffer(pointer);
buffer.Seek(0);
// String str = new String(buffer._buffer);
// System.out.println(str);
var unmarshallingContext = new UnmarshallingContext(Trans(), @ref
, Const4.AddToIdTree, false);
unmarshallingContext.Buffer(buffer);
unmarshallingContext.ActivationDepth(new LegacyActivationDepth(5));
return unmarshallingContext.Read();
}
示例13: 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;
}
示例14: _IReferenceSource_33
public _IReferenceSource_33(ObjectReference reference)
{
this.reference = reference;
}
示例15: RemoveReference
public virtual void RemoveReference(ObjectReference reference)
{
RemoveReference(new _IReferenceSource_33(reference));
}