本文整理汇总了C#中Db4objects.Db4o.Internal.ClassAspect类的典型用法代码示例。如果您正苦于以下问题:C# ClassAspect类的具体用法?C# ClassAspect怎么用?C# ClassAspect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClassAspect类属于Db4objects.Db4o.Internal命名空间,在下文中一共展示了ClassAspect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Defrag
public override void Defrag(ClassMetadata classMetadata, ClassAspect aspect, LatinStringIO
sio, DefragmentContextImpl context)
{
base.Defrag(classMetadata, aspect, sio, context);
if (!(aspect is FieldMetadata))
{
return;
}
FieldMetadata field = (FieldMetadata)aspect;
if (field.IsVirtual())
{
return;
}
if (field.HasIndex())
{
BTree index = field.GetIndex(context.SystemTrans());
int targetIndexID = context.CopyID();
if (targetIndexID != 0)
{
index.DefragBTree(context.Services());
}
}
else
{
context.WriteInt(0);
}
}
示例2: Write
public override void Write(Transaction trans, ClassMetadata clazz, ClassAspect aspect
, ByteArrayBuffer writer)
{
writer.WriteShortString(trans, aspect.GetName());
if (!(aspect is FieldMetadata))
{
return;
}
FieldMetadata field = (FieldMetadata)aspect;
field.Alive();
if (field.IsVirtual())
{
return;
}
ITypeHandler4 handler = field.GetHandler();
if (handler is StandardReferenceTypeHandler)
{
// TODO: ensure there is a test case, to make this happen
if (((StandardReferenceTypeHandler)handler).ClassMetadata().GetID() == 0)
{
trans.Container().NeedsUpdate(clazz);
}
}
writer.WriteInt(field.FieldTypeID());
BitMap4 bitmap = new BitMap4(3);
bitmap.Set(0, field.IsPrimitive());
bitmap.Set(1, Handlers4.HandlesArray(handler));
bitmap.Set(2, Handlers4.HandlesMultidimensionalArray(handler));
// keep the order
writer.WriteByte(bitmap.GetByte(0));
}
示例3: ProcessAspect
public virtual void ProcessAspect(ClassAspect aspect, int currentSlot)
{
if (aspect is FieldMetadata)
{
Process((FieldMetadata)aspect);
}
}
示例4: ProcessAspect
public virtual void ProcessAspect(ClassAspect aspect, int currentSlot)
{
if (Accept(aspect))
{
ProcessAspect(aspect, currentSlot, _marshallingInfo.IsNull(currentSlot));
}
_marshallingInfo.BeginSlot();
}
示例5: ProcessAspect
protected override void ProcessAspect(ClassAspect aspect, int currentSlot, bool isNull
)
{
if (!isNull)
{
aspect.DefragAspect(context);
}
}
示例6: ProcessAspectOnMissingClass
public virtual void ProcessAspectOnMissingClass(ClassAspect aspect, int currentSlot
)
{
if (_marshallingInfo.IsNull(currentSlot))
{
return;
}
aspect.IncrementOffset(_marshallingInfo.Buffer());
}
示例7: MarshalledLength
public override int MarshalledLength(ObjectContainerBase stream, ClassAspect aspect
)
{
int len = base.MarshalledLength(stream, aspect);
if (!(aspect is FieldMetadata))
{
return len;
}
FieldMetadata field = (FieldMetadata)aspect;
if (!HasBTreeIndex(field))
{
return len;
}
return len + Const4.IdLength;
}
示例8: Write
public override void Write(Transaction trans, ClassMetadata clazz, ClassAspect aspect
, ByteArrayBuffer writer)
{
base.Write(trans, clazz, aspect, writer);
if (!(aspect is FieldMetadata))
{
return;
}
FieldMetadata field = (FieldMetadata)aspect;
if (!HasBTreeIndex(field))
{
return;
}
writer.WriteIDOf(trans, field.GetIndex(trans));
}
示例9: MarshalledLength
public override int MarshalledLength(ObjectContainerBase stream, ClassAspect aspect
)
{
int len = stream.StringIO().ShortLength(aspect.GetName());
if (aspect is FieldMetadata)
{
FieldMetadata field = (FieldMetadata)aspect;
if (field.NeedsArrayAndPrimitiveInfo())
{
len += 1;
}
if (!(field is VirtualFieldMetadata))
{
len += Const4.IdLength;
}
}
return len;
}
示例10: ToClassAspectArray
private ClassAspect[] ToClassAspectArray(Collection4 aspects)
{
var array = new ClassAspect[aspects.Size()];
aspects.ToArray(array);
for (var i = 0; i < array.Length; i++)
{
array[i].SetHandle(i);
}
return array;
}
示例11: ProcessAspect
// do nothing
public void ProcessAspect(ClassAspect aspect, int currentSlot)
{
if (aspect.IsEnabledOn(AspectVersionContextImpl.CheckAlwaysEnabled))
{
aspect.Deactivate(context);
}
}
示例12: ProcessAspectOnMissingClass
public void ProcessAspectOnMissingClass(ClassAspect aspect, int currentSlot)
{
}
示例13: SeekToField
public bool SeekToField(ObjectHeaderContext context, ClassAspect field)
{
if (!StandardReferenceTypeHandlerIsUsed())
{
return false;
}
return Handlers4.FieldAwareTypeHandler(CorrectHandlerVersion(context)).SeekToField
(context, field);
}
示例14: ProcessAspectOnMissingClass
public override void ProcessAspectOnMissingClass(ClassAspect aspect, int currentSlot
)
{
((MarshallingContext)context).IsNull(currentSlot, true);
}
示例15: Accept
public override bool Accept(ClassAspect aspect)
{
return aspect.IsEnabledOn(context);
}