本文整理汇总了C#中Db4objects.Db4o.Internal.ClassAspect类的典型用法代码示例。如果您正苦于以下问题:C# ClassAspect类的具体用法?C# ClassAspect怎么用?C# ClassAspect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClassAspect类属于Db4objects.Db4o.Internal命名空间,在下文中一共展示了ClassAspect类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:superyfwy,项目名称:db4o,代码行数:27,代码来源:FieldMarshaller1.cs
示例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));
}
开发者ID:Galigator,项目名称:db4o,代码行数:31,代码来源:FieldMarshaller0.cs
示例3: ProcessAspect
public virtual void ProcessAspect(ClassAspect aspect, int currentSlot)
{
if (aspect is FieldMetadata)
{
Process((FieldMetadata)aspect);
}
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:7,代码来源:TraverseFieldCommand.cs
示例4: ProcessAspect
public virtual void ProcessAspect(ClassAspect aspect, int currentSlot)
{
if (Accept(aspect))
{
ProcessAspect(aspect, currentSlot, _marshallingInfo.IsNull(currentSlot));
}
_marshallingInfo.BeginSlot();
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:8,代码来源:MarshallingInfoTraverseAspectCommand.cs
示例5: ProcessAspect
protected override void ProcessAspect(ClassAspect aspect, int currentSlot, bool isNull
)
{
if (!isNull)
{
aspect.DefragAspect(context);
}
}
开发者ID:Galigator,项目名称:db4o,代码行数:8,代码来源:StandardReferenceTypeHandler.cs
示例6: ProcessAspectOnMissingClass
public virtual void ProcessAspectOnMissingClass(ClassAspect aspect, int currentSlot
)
{
if (_marshallingInfo.IsNull(currentSlot))
{
return;
}
aspect.IncrementOffset(_marshallingInfo.Buffer());
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:9,代码来源:MarshallingInfoTraverseAspectCommand.cs
示例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;
}
开发者ID:superyfwy,项目名称:db4o,代码行数:15,代码来源:FieldMarshaller1.cs
示例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));
}
开发者ID:superyfwy,项目名称:db4o,代码行数:15,代码来源:FieldMarshaller1.cs
示例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;
}
开发者ID:Galigator,项目名称:db4o,代码行数:18,代码来源:FieldMarshaller0.cs
示例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;
}
开发者ID:masroore,项目名称:db4o,代码行数:10,代码来源:ClassMetadata.cs
示例11: ProcessAspect
// do nothing
public void ProcessAspect(ClassAspect aspect, int currentSlot)
{
if (aspect.IsEnabledOn(AspectVersionContextImpl.CheckAlwaysEnabled))
{
aspect.Deactivate(context);
}
}
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:ClassMetadata.cs
示例12: ProcessAspectOnMissingClass
public void ProcessAspectOnMissingClass(ClassAspect aspect, int currentSlot)
{
}
开发者ID:masroore,项目名称:db4o,代码行数:3,代码来源:ClassMetadata.cs
示例13: SeekToField
public bool SeekToField(ObjectHeaderContext context, ClassAspect field)
{
if (!StandardReferenceTypeHandlerIsUsed())
{
return false;
}
return Handlers4.FieldAwareTypeHandler(CorrectHandlerVersion(context)).SeekToField
(context, field);
}
开发者ID:masroore,项目名称:db4o,代码行数:9,代码来源:ClassMetadata.cs
示例14: ProcessAspectOnMissingClass
public override void ProcessAspectOnMissingClass(ClassAspect aspect, int currentSlot
)
{
((MarshallingContext)context).IsNull(currentSlot, true);
}
开发者ID:Galigator,项目名称:db4o,代码行数:5,代码来源:StandardReferenceTypeHandler.cs
示例15: Accept
public override bool Accept(ClassAspect aspect)
{
return aspect.IsEnabledOn(context);
}
开发者ID:Galigator,项目名称:db4o,代码行数:4,代码来源:StandardReferenceTypeHandler.cs
示例16: IsCollectIdTypehandlerAspect
private bool IsCollectIdTypehandlerAspect(ClassAspect aspect)
{
if (!(aspect is TypeHandlerAspect))
{
return false;
}
ITypeHandler4 typehandler = ((TypeHandlerAspect)aspect)._typeHandler;
return Handlers4.IsCascading(typehandler);
}
开发者ID:Galigator,项目名称:db4o,代码行数:9,代码来源:StandardReferenceTypeHandler.cs
示例17: InstallTranslatorOnExistingAspect
private bool InstallTranslatorOnExistingAspect(IObjectTranslator translator, ClassAspect
existingAspect, Collection4 aspects)
{
if (existingAspect is TranslatedAspect)
{
var translatedAspect = (TranslatedAspect) existingAspect;
translatedAspect.InitializeTranslator(translator);
_translator = translatedAspect;
return false;
}
// older versions didn't store the aspect type properly
_translator = new TranslatedAspect(this, translator);
aspects.ReplaceByIdentity(existingAspect, _translator);
return true;
}
开发者ID:masroore,项目名称:db4o,代码行数:15,代码来源:ClassMetadata.cs
示例18: ReplaceAspectByName
private bool ReplaceAspectByName(Collection4 aspects, ClassAspect aspect)
{
var existing = AspectByName(aspects, aspect.GetName());
if (existing == null)
{
return false;
}
aspects.ReplaceByIdentity(existing, aspect);
return true;
}
开发者ID:masroore,项目名称:db4o,代码行数:10,代码来源:ClassMetadata.cs
示例19: Process
public void Process(ITraverseAspectCommand command, ClassAspect currentAspect, int
currentSlot)
{
command.ProcessAspectOnMissingClass(currentAspect, currentSlot);
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:5,代码来源:ModifiedAspectTraversalStrategy.cs
示例20: SeekToField
public virtual bool SeekToField(ObjectHeaderContext context, ClassAspect aspect)
{
BooleanByRef found = new BooleanByRef(false);
ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_456(aspect
, found, context, EnsureFieldList(context));
TraverseAllAspects(context, command);
return found.value;
}
开发者ID:Galigator,项目名称:db4o,代码行数:8,代码来源:StandardReferenceTypeHandler.cs
注:本文中的Db4objects.Db4o.Internal.ClassAspect类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论