当前位置: 首页>>代码示例>>C#>>正文


C# QueryingReadContext.Seek方法代码示例

本文整理汇总了C#中Db4objects.Db4o.Internal.Marshall.QueryingReadContext.Seek方法的典型用法代码示例。如果您正苦于以下问题:C# QueryingReadContext.Seek方法的具体用法?C# QueryingReadContext.Seek怎么用?C# QueryingReadContext.Seek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Db4objects.Db4o.Internal.Marshall.QueryingReadContext的用法示例。


在下文中一共展示了QueryingReadContext.Seek方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadCandidateHandler

 public virtual ITypeHandler4 ReadCandidateHandler(QueryingReadContext context)
 {
     var payLoadOffSet = context.ReadInt();
     if (payLoadOffSet == 0)
     {
         return null;
     }
     context.Seek(payLoadOffSet);
     var classMetadataID = context.ReadInt();
     var classMetadata = context.Container().ClassMetadataForID(classMetadataID
         );
     if (classMetadata == null)
     {
         return null;
     }
     return classMetadata.ReadCandidateHandler(context);
 }
开发者ID:masroore,项目名称:db4o,代码行数:17,代码来源:OpenTypeHandler.cs

示例2: ReadCandidateHandler

		public override ITypeHandler4 ReadCandidateHandler(QueryingReadContext context)
		{
			int id = 0;
			int offset = context.Offset();
			try
			{
				id = context.ReadInt();
			}
			catch (Exception)
			{
			}
			context.Seek(offset);
			if (id != 0)
			{
				StatefulBuffer reader = context.Container().ReadStatefulBufferById(context.Transaction
					(), id);
				if (reader != null)
				{
					ObjectHeader oh = new ObjectHeader(context.Container(), reader);
					try
					{
						if (oh.ClassMetadata() != null)
						{
							context.Buffer(reader);
							return oh.ClassMetadata().SeekCandidateHandler(context);
						}
					}
					catch (Exception e)
					{
					}
				}
			}
			// TODO: Check Exception Types
			// Errors typically occur, if classes don't match
			return null;
		}
开发者ID:Galigator,项目名称:db4o,代码行数:36,代码来源:OpenTypeHandler0.cs

示例3: CreateChild

 internal virtual bool CreateChild(QCandidates a_candidates)
 {
     if (!_include)
     {
         return false;
     }
     if (_fieldMetadata != null)
     {
         var handler = _fieldMetadata.GetHandler();
         if (handler != null)
         {
             var queryingReadContext = new QueryingReadContext(Transaction(),
                 MarshallerFamily().HandlerVersion(), _bytes, _key);
             var arrayElementHandler = Handlers4.ArrayElementHandler(handler, queryingReadContext
                 );
             if (arrayElementHandler != null)
             {
                 var offset = queryingReadContext.Offset();
                 var outerRes = true;
                 // The following construct is worse than not ideal.
                 // For each constraint it completely reads the
                 // underlying structure again. The structure could b
                 // kept fairly easy. TODO: Optimize!
                 var i = a_candidates.IterateConstraints();
                 while (i.MoveNext())
                 {
                     var qcon = (QCon) i.Current;
                     var qf = qcon.GetField();
                     if (qf == null || qf.Name().Equals(_fieldMetadata.GetName()))
                     {
                         var tempParent = qcon.Parent();
                         qcon.SetParent(null);
                         var candidates = new QCandidates(a_candidates.i_trans, null, qf);
                         candidates.AddConstraint(qcon);
                         qcon.SetCandidates(candidates);
                         ReadArrayCandidates(handler, queryingReadContext.Buffer(), arrayElementHandler,
                             candidates
                             );
                         queryingReadContext.Seek(offset);
                         var isNot = qcon.IsNot();
                         if (isNot)
                         {
                             qcon.RemoveNot();
                         }
                         candidates.Evaluate();
                         var pending = ByRef.NewInstance();
                         bool[] innerRes = {isNot};
                         candidates.Traverse(new _IVisitor4_160(innerRes, isNot, pending));
                         // Collect all pending subresults.
                         // We need to change
                         // the
                         // constraint here, so
                         // our
                         // pending collector
                         // uses
                         // the right
                         // comparator.
                         // We only keep one
                         // pending result
                         // for
                         // all array
                         // elements.
                         // and memorize,
                         // whether we had a
                         // true or a false
                         // result.
                         // or both.
                         if (isNot)
                         {
                             qcon.Not();
                         }
                         // In case we had pending subresults, we
                         // need to communicate
                         // them up to our root.
                         if (((Tree) pending.value) != null)
                         {
                             ((Tree) pending.value).Traverse(new _IVisitor4_229(this));
                         }
                         if (!innerRes[0])
                         {
                             // Again this could be double triggering.
                             // 
                             // We want to clean up the "No route"
                             // at some stage.
                             qcon.Visit(GetRoot(), qcon.Evaluator().Not(false));
                             outerRes = false;
                         }
                         qcon.SetParent(tempParent);
                     }
                 }
                 return outerRes;
             }
             // We may get simple types here too, if the YapField was null
             // in the higher level simple evaluation. Evaluate these
             // immediately.
             if (Handlers4.IsQueryLeaf(handler))
             {
                 a_candidates.i_currentConstraint.Visit(this);
                 return true;
             }
//.........这里部分代码省略.........
开发者ID:masroore,项目名称:db4o,代码行数:101,代码来源:QCandidate.cs

示例4: ReadSubCandidate

		public QCandidate ReadSubCandidate(QueryingReadContext context, ITypeHandler4 handler
			)
		{
			ObjectID objectID = ObjectID.NotPossible;
			try
			{
				int offset = context.Offset();
				if (handler is IReadsObjectIds)
				{
					objectID = ((IReadsObjectIds)handler).ReadObjectID(context);
				}
				if (objectID.IsValid())
				{
					return new QCandidate(this, null, objectID._id);
				}
				if (objectID == ObjectID.NotPossible)
				{
					context.Seek(offset);
					object obj = context.Read(handler);
					if (obj != null)
					{
						QCandidate candidate = new QCandidate(this, obj, context.Container().GetID(context
							.Transaction(), obj));
						candidate.ClassMetadata(context.Container().ClassMetadataForObject(obj));
						return candidate;
					}
				}
			}
			catch (Exception)
			{
			}
			// FIXME: Catchall
			return null;
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:34,代码来源:QCandidates.cs

示例5: SeekCandidateHandler

 public virtual ITypeHandler4 SeekCandidateHandler(QueryingReadContext context)
 {
     if (IsArray())
     {
         if (Platform4.IsCollectionTranslator(_config))
         {
             context.Seek(context.Offset() + Const4.IntLength);
             return new ArrayHandler(null, false);
         }
         IncrementFieldsOffset1((ByteArrayBuffer) context.Buffer(), context);
         if (_ancestor != null)
         {
             return _ancestor.SeekCandidateHandler(context);
         }
     }
     return null;
 }
开发者ID:masroore,项目名称:db4o,代码行数:17,代码来源:ClassMetadata.cs


注:本文中的Db4objects.Db4o.Internal.Marshall.QueryingReadContext.Seek方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。