本文整理汇总了C#中Db4objects.Db4o.Internal.ClassMetadata类的典型用法代码示例。如果您正苦于以下问题:C# ClassMetadata类的具体用法?C# ClassMetadata怎么用?C# ClassMetadata使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClassMetadata类属于Db4objects.Db4o.Internal命名空间,在下文中一共展示了ClassMetadata类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessObjectSlot
/// <exception cref="Db4objects.Db4o.CorruptionException"></exception>
/// <exception cref="System.IO.IOException"></exception>
public void ProcessObjectSlot(DefragmentServicesImpl services, ClassMetadata classMetadata
, int id)
{
ByteArrayBuffer sourceBuffer = services.SourceBufferByID(id);
DefragmentContextImpl.ProcessCopy(services, id, new _ISlotCopyHandler_43(this, services
), sourceBuffer);
}
示例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: ModifiedAspectTraversalStrategy
public ModifiedAspectTraversalStrategy(ClassMetadata classMetadata, IList ancestors
)
{
_classDiffs = new ArrayList();
_classDiffs.Add(new HierarchyAnalyzer.Same(classMetadata));
Sharpen.Collections.AddAll(_classDiffs, ancestors);
}
示例4: DatabaseIdentityIDAndUUID
/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
private DatabaseIdentityIDAndUUID ReadDatabaseIdentityIDAndUUID
(ObjectContainerBase container, ClassMetadata classMetadata, Slot oldSlot, bool
checkClass)
{
if (DTrace.enabled)
{
DTrace.RereadOldUuid.LogLength(oldSlot.Address(), oldSlot.Length());
}
var reader = container.DecryptedBufferByAddress(oldSlot.Address(), oldSlot
.Length());
if (checkClass)
{
var realClass = ClassMetadata.ReadClass(container, reader);
if (realClass != classMetadata)
{
return null;
}
}
if (classMetadata.SeekToField(container.Transaction, reader, this) == HandlerVersion
.Invalid)
{
return null;
}
return new DatabaseIdentityIDAndUUID(reader.ReadInt(), reader.ReadLong
());
}
示例5: Process
internal virtual void Process(ClassMetadata newClassMetadata)
{
if (_pending.Contains(newClassMetadata))
{
return;
}
ClassMetadata ancestor = newClassMetadata.GetAncestor();
if (ancestor != null)
{
Process(ancestor);
}
_pending.Add(newClassMetadata);
_members.Add(newClassMetadata);
if (_running)
{
return;
}
_running = true;
try
{
CheckInits();
_pending = new Collection4();
}
finally
{
_running = false;
}
}
示例6: QCandidates
internal QCandidates(LocalTransaction a_trans, ClassMetadata a_classMetadata, QField
a_field, bool isTopLevel)
{
// Transaction necessary as reference to stream
// collection of all constraints
// possible class information
// possible field information
// current executing constraint, only set where needed
_result = new QueryResultCandidates(this);
_isTopLevel = isTopLevel;
i_trans = a_trans;
_classMetadata = a_classMetadata;
_field = a_field;
if (a_field == null || a_field._fieldMetadata == null || !(a_field._fieldMetadata
.GetHandler() is StandardReferenceTypeHandler))
{
return;
}
ClassMetadata yc = ((StandardReferenceTypeHandler)a_field._fieldMetadata.GetHandler
()).ClassMetadata();
if (_classMetadata == null)
{
_classMetadata = yc;
}
else
{
yc = _classMetadata.GetHigherOrCommonHierarchy(yc);
if (yc != null)
{
_classMetadata = yc;
}
}
}
示例7: QCandidates
internal QCandidates(LocalTransaction a_trans, ClassMetadata a_classMetadata, QField
a_field)
{
// Transaction necessary as reference to stream
// root of the QCandidate tree
// collection of all constraints
// possible class information
// possible field information
// current executing constraint, only set where needed
i_trans = a_trans;
i_classMetadata = a_classMetadata;
_field = a_field;
if (a_field == null || a_field._fieldMetadata == null || !(a_field._fieldMetadata
.GetHandler() is StandardReferenceTypeHandler))
{
return;
}
ClassMetadata yc = ((StandardReferenceTypeHandler)a_field._fieldMetadata.GetHandler
()).ClassMetadata();
if (i_classMetadata == null)
{
i_classMetadata = yc;
}
else
{
yc = i_classMetadata.GetHigherOrCommonHierarchy(yc);
if (yc != null)
{
i_classMetadata = yc;
}
}
}
示例8: 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);
}
}
示例9: ActivationDepthFor
public virtual IActivationDepth ActivationDepthFor(ClassMetadata classMetadata, ActivationMode
mode)
{
Record(new MethodCall("activationDepthFor", new object[] { classMetadata, mode })
);
return _delegate.ActivationDepthFor(classMetadata, mode);
}
示例10: InstanceCount
public override int InstanceCount(ClassMetadata clazz, Transaction trans)
{
lock (Lock())
{
return clazz.IndexEntryCount(trans);
}
}
示例11: GetWriter
public MsgD GetWriter(Transaction trans, Pointer4 pointer, ClassMetadata classMetadata
, int param, ByteArrayBuffer buffer)
{
return GetWriter(trans, pointer, buffer, new[]
{
classMetadata.GetID(), param
});
}
示例12: _IProcedure4_39
public _IProcedure4_39(ClassMarshaller _enclosing, Transaction trans, ClassMetadata
clazz, ByteArrayBuffer writer)
{
this._enclosing = _enclosing;
this.trans = trans;
this.clazz = clazz;
this.writer = writer;
}
示例13: Adjust
public virtual IUpdateDepth Adjust(ClassMetadata clazz)
{
if (clazz.CascadesOnDeleteOrUpdate())
{
return AdjustDepthToBorders().Descend();
}
return Descend();
}
示例14: RegisterClassMetadataById
private void RegisterClassMetadataById(ClassMetadata clazz)
{
if (clazz.GetID() == 0)
{
clazz.Write(_systemTransaction);
}
_classMetadataByID.Put(clazz.GetID(), clazz);
}
示例15: Diff
public Diff(Db4objects.Db4o.Internal.ClassMetadata classMetadata)
{
if (classMetadata == null)
{
throw new ArgumentNullException();
}
_classMetadata = classMetadata;
}