internal static void ForEachCollectionElement(Object obj, IVisitor4 visitor)
        {
            IEnumerator enumerator = GetCollectionEnumerator(obj, false);

            if (enumerator != null)
            {
                // If obj is a map (IDictionary in .NET speak) call Visit() with the key
                // otherwise use the element itself
                if (enumerator is IDictionaryEnumerator)
                {
                    IDictionaryEnumerator dictEnumerator = enumerator as IDictionaryEnumerator;
                    while (enumerator.MoveNext())
                    {
                        visitor.Visit(dictEnumerator.Key);
                    }
                }
                else
                {
                    while (enumerator.MoveNext())
                    {
                        visitor.Visit(enumerator.Current);
                    }
                }
            }
        }
                    public void Accept(IVisitor4 visitor)
                    {
                        SlotChange slotChange = new SlotChange(id);

                        slotChange.NotifySlotCreated(new Slot(address, length));
                        visitor.Visit(slotChange);
                    }
Beispiel #3
0
            public void Visit(object obj)
            {
                var key = (IFieldIndexKey)obj;

                userVisitor.Visit(((IIndexableTypeHandler)_enclosing.GetHandler()).IndexEntryToObject
                                      (context, key.Value()));
            }
Beispiel #4
0
                public void Visit(object idSlotMapping)
                {
                    var slotChange = new SlotChange(((TreeInt)idSlotMapping)._key);

                    slotChange.NotifySlotCreated(((IdSlotTree)idSlotMapping).Slot());
                    outSideVisitor.Visit(slotChange);
                }
Beispiel #5
0
 protected override void Process(FieldMetadata field)
 {
     if (field.CanAddToQuery(fieldName))
     {
         visitor.Visit(new object[] { classMetadata, field });
     }
 }
		public static void TraverseKeys(IBTreeRange result, IVisitor4 visitor)
		{
			IEnumerator i = result.Keys();
			while (i.MoveNext())
			{
				visitor.Visit(i.Current);
			}
		}
            public void Visit(object a_object)
            {
                var fsn     = (FreeSlotNode)a_object;
                var address = fsn._key;
                var length  = fsn._peer._key;

                visitor.Visit(new Slot(address, length));
            }
Beispiel #8
0
 public void Accept(IVisitor4 visitor)
 {
     for (int slotChangeIndex = 0; slotChangeIndex < slotChanges.Length; ++slotChangeIndex)
     {
         SlotChange slotChange = slotChanges[slotChangeIndex];
         visitor.Visit(slotChange);
     }
 }
Beispiel #9
0
 public void Accept(IVisitor4 visitor)
 {
     for (IEnumerator expectedFreeIdIter = ids.GetEnumerator(); expectedFreeIdIter.MoveNext
              ();)
     {
         int expectedFreeId = ((int)expectedFreeIdIter.Current);
         visitor.Visit(expectedFreeId);
     }
 }
Beispiel #10
0
        public virtual void VisitCachedReferences(IVisitor4 visitor)
        {
            IEnumerator i = _referencesByObject.Values.GetEnumerator();

            while (i.MoveNext())
            {
                visitor.Visit(i.Current);
            }
        }
Beispiel #11
0
        public static void TraverseKeys(IBTreeRange result, IVisitor4 visitor)
        {
            IEnumerator i = result.Keys();

            while (i.MoveNext())
            {
                visitor.Visit(i.Current);
            }
        }
Beispiel #12
0
        public virtual void TraverseAllIndexSlots(BTree btree, IVisitor4 command)
        {
            IEnumerator slotIDIter = btree.AllNodeIds(Sourcedb.Transaction(this));

            while (slotIDIter.MoveNext())
            {
                command.Visit(slotIDIter.Current);
            }
        }
Beispiel #13
0
		public virtual void TraverseMutable(IVisitor4 visitor)
		{
			Collection4 currentContent = new Collection4();
			TraverseLocked(new _IVisitor4_51(currentContent));
			IEnumerator i = currentContent.GetEnumerator();
			while (i.MoveNext())
			{
				visitor.Visit(i.Current);
			}
		}
Beispiel #14
0
        protected virtual void Foreach(IExtObjectContainer container, Type clazz, IVisitor4
                                       visitor)
        {
            IObjectSet set = NewQuery(container, clazz).Execute();

            while (set.HasNext())
            {
                visitor.Visit(set.Next());
            }
        }
Beispiel #15
0
        public virtual void TraverseAllIndexSlots(ClassMetadata classMetadata, IVisitor4
                                                  command)
        {
            IEnumerator slotIDIter = classMetadata.Index().AllSlotIDs(Sourcedb.Transaction(this
                                                                                           ));

            while (slotIDIter.MoveNext())
            {
                command.Visit(slotIDIter.Current);
            }
        }
Beispiel #16
0
 public void TraverseFromLeaves(IVisitor4 a_visitor)
 {
     if (_preceding != null)
     {
         _preceding.TraverseFromLeaves(a_visitor);
     }
     if (_subsequent != null)
     {
         _subsequent.TraverseFromLeaves(a_visitor);
     }
     a_visitor.Visit(this);
 }
Beispiel #17
0
 public void Traverse(IVisitor4 visitor)
 {
     if (_preceding != null)
     {
         _preceding.Traverse(visitor);
     }
     visitor.Visit((Tree)this);
     if (_subsequent != null)
     {
         _subsequent.Traverse(visitor);
     }
 }
Beispiel #18
0
        public virtual void TraverseMutable(IVisitor4 visitor)
        {
            var currentContent = new Collection4();

            TraverseLocked(new _IVisitor4_51(currentContent));
            var i = currentContent.GetEnumerator();

            while (i.MoveNext())
            {
                visitor.Visit(i.Current);
            }
        }
Beispiel #19
0
 public virtual void Hc_traverse(IVisitor4 visitor)
 {
     if (_hcPreceding != null)
     {
         _hcPreceding.Hc_traverse(visitor);
     }
     if (_hcSubsequent != null)
     {
         _hcSubsequent.Hc_traverse(visitor);
     }
     // Traversing the leaves first allows to add ObjectReference
     // nodes to different ReferenceSystem trees during commit
     visitor.Visit(this);
 }
Beispiel #20
0
        /// <summary>This traversal goes over all nodes, not just leafs</summary>
        internal void TraverseAllNodes(Transaction trans, IVisitor4 command)
        {
            ByteArrayBuffer reader = PrepareRead(trans);

            command.Visit(this);
            if (_isLeaf)
            {
                return;
            }
            for (int childIdx = 0; childIdx < _count; childIdx++)
            {
                Child(reader, childIdx).TraverseAllNodes(trans, command);
            }
        }
Beispiel #21
0
 public virtual void ForEachKeyForIdentity(IVisitor4 visitor, object obj)
 {
     for (int i = 0; i < _table.Length; i++)
     {
         HashtableIntEntry entry = _table[i];
         while (entry != null)
         {
             if (entry._object == obj)
             {
                 visitor.Visit(entry.Key());
             }
             entry = entry._next;
         }
     }
 }
Beispiel #22
0
 public virtual void ForEachKeyForIdentity(IVisitor4 visitor, object obj)
 {
     for (var i = 0; i < _table.Length; i++)
     {
         var entry = _table[i];
         while (entry != null)
         {
             if (entry._object == obj)
             {
                 visitor.Visit(entry.Key());
             }
             entry = entry._next;
         }
     }
 }
Beispiel #23
0
        internal virtual void ForEachChildField(string name, IVisitor4 visitor)
        {
            IEnumerator i = IterateChildren();

            while (i.MoveNext())
            {
                object obj = i.Current;
                if (obj is QConObject)
                {
                    if (((QConObject)obj).GetField().Name().Equals(name))
                    {
                        visitor.Visit(obj);
                    }
                }
            }
        }
        public void IterateTopLevelClasses(IVisitor4 visitor)
        {
            ClassMetadataIterator i = Iterator();

            while (i.MoveNext())
            {
                ClassMetadata classMetadata = i.CurrentClass();
                if (!classMetadata.IsInternal())
                {
                    if (classMetadata.GetAncestor() == null)
                    {
                        visitor.Visit(classMetadata);
                    }
                }
            }
        }
Beispiel #25
0
        public void TraverseKeys(Transaction trans, IVisitor4 visitor)
        {
            ByteArrayBuffer reader = PrepareRead(trans);

            if (_isLeaf)
            {
                for (int i = 0; i < _count; i++)
                {
                    object obj = Key(trans, reader, i);
                    if (obj != No4.Instance)
                    {
                        visitor.Visit(obj);
                    }
                }
            }
            else
            {
                for (int i = 0; i < _count; i++)
                {
                    Child(reader, i).TraverseKeys(trans, visitor);
                }
            }
        }
        internal virtual void CollectConstraints(Transaction trans, QConObject a_parent,
                                                 object a_template, IVisitor4 a_visitor)
        {
            object obj = GetOn(trans, a_template);

            if (obj != null)
            {
                Collection4 objs = Platform4.FlattenCollection(trans.Container(), obj);
                IEnumerator j    = objs.GetEnumerator();
                while (j.MoveNext())
                {
                    obj = j.Current;
                    if (obj != null)
                    {
                        if (_isPrimitive && !_isArray)
                        {
                            object nullValue = _reflectField.GetFieldType().NullValue();
                            if (obj.Equals(nullValue))
                            {
                                return;
                            }
                        }
                        if (Platform4.IgnoreAsConstraint(obj))
                        {
                            return;
                        }
                        if (!a_parent.HasObjectInParentPath(obj))
                        {
                            QConObject constraint = new QConObject(trans, a_parent, QField(trans), obj);
                            constraint.ByExample();
                            a_visitor.Visit(constraint);
                        }
                    }
                }
            }
        }
Beispiel #27
0
		internal virtual void ForEachChildField(string name, IVisitor4 visitor)
		{
			IEnumerator i = IterateChildren();
			while (i.MoveNext())
			{
				object obj = i.Current;
				if (obj is QConObject)
				{
					if (((QConObject)obj).GetField().Name().Equals(name))
					{
						visitor.Visit(obj);
					}
				}
			}
		}
Beispiel #28
0
		public void TraverseFromLeaves(IVisitor4 a_visitor)
		{
			if (_preceding != null)
			{
				_preceding.TraverseFromLeaves(a_visitor);
			}
			if (_subsequent != null)
			{
				_subsequent.TraverseFromLeaves(a_visitor);
			}
			a_visitor.Visit(this);
		}
Beispiel #29
0
				public void Accept(IVisitor4 visitor)
				{
					for (IEnumerator expectedFreeIdIter = ids.GetEnumerator(); expectedFreeIdIter.MoveNext
						(); )
					{
						int expectedFreeId = ((int)expectedFreeIdIter.Current);
						visitor.Visit(expectedFreeId);
					}
				}
Beispiel #30
0
				public void Accept(IVisitor4 visitor)
				{
					visitor.Visit(id);
				}
Beispiel #31
0
 public void Visit(object obj)
 {
     visitor.Visit(((TreeIntObject)obj).GetObject());
 }
 public void Accept(IVisitor4 visitor)
 {
     var slotChange = new SlotChange(id);
     slotChange.NotifySlotCreated(new Slot(address, length));
     visitor.Visit(slotChange);
 }
 public void Visit(object slot)
 {
     visitor.Visit(_enclosing._blockConverter.ToNonBlockedLength(((Slot)slot)));
 }
		internal virtual void CollectConstraints(Transaction trans, QConObject a_parent, 
			object a_template, IVisitor4 a_visitor)
		{
			object obj = GetOn(trans, a_template);
			if (obj != null)
			{
				Collection4 objs = Platform4.FlattenCollection(trans.Container(), obj);
				IEnumerator j = objs.GetEnumerator();
				while (j.MoveNext())
				{
					obj = j.Current;
					if (obj != null)
					{
						if (_isPrimitive && !_isArray)
						{
							object nullValue = _reflectField.GetFieldType().NullValue();
							if (obj.Equals(nullValue))
							{
								return;
							}
						}
						if (Platform4.IgnoreAsConstraint(obj))
						{
							return;
						}
						if (!a_parent.HasObjectInParentPath(obj))
						{
							QConObject constraint = new QConObject(trans, a_parent, QField(trans), obj);
							constraint.ByExample();
							a_visitor.Visit(constraint);
						}
					}
				}
			}
		}
Beispiel #35
0
 public void Accept(IVisitor4 visitor)
 {
     visitor.Visit(id);
 }
Beispiel #36
0
		/// <summary>This traversal goes over all nodes, not just leafs</summary>
		internal void TraverseAllNodes(Transaction trans, IVisitor4 command)
		{
			ByteArrayBuffer reader = PrepareRead(trans);
			command.Visit(this);
			if (_isLeaf)
			{
				return;
			}
			for (int childIdx = 0; childIdx < _count; childIdx++)
			{
				Child(reader, childIdx).TraverseAllNodes(trans, command);
			}
		}
		public virtual void VisitCachedReferences(IVisitor4 visitor)
		{
			IEnumerator i = _referencesByObject.Values.GetEnumerator();
			while (i.MoveNext())
			{
				visitor.Visit(i.Current);
			}
		}
Beispiel #38
0
 internal static void ForEachCollectionElement(Object obj, IVisitor4 visitor)
 {
     IEnumerator enumerator = GetCollectionEnumerator(obj, false);
     if (enumerator != null)
     {
         // If obj is a map (IDictionary in .NET speak) call Visit() with the key
         // otherwise use the element itself
         if (enumerator is IDictionaryEnumerator)
         {
             IDictionaryEnumerator dictEnumerator = enumerator as IDictionaryEnumerator;
             while (enumerator.MoveNext())
             {
                 visitor.Visit(dictEnumerator.Key);
             }
         }
         else
         {
             while (enumerator.MoveNext())
             {
                 visitor.Visit(enumerator.Current);
             }
         }
     }
 }
Beispiel #39
0
		public virtual void TraverseAllIndexSlots(ClassMetadata classMetadata, IVisitor4 
			command)
		{
			IEnumerator slotIDIter = classMetadata.Index().AllSlotIDs(Sourcedb.Transaction(this
				));
			while (slotIDIter.MoveNext())
			{
				command.Visit(slotIDIter.Current);
			}
		}
Beispiel #40
0
            public void Visit(object obj)
            {
                var tree = (Tree)obj;

                visitor.Visit(tree.Key());
            }
Beispiel #41
0
		public virtual void TraverseAllIndexSlots(BTree btree, IVisitor4 command)
		{
			IEnumerator slotIDIter = btree.AllNodeIds(Sourcedb.Transaction(this));
			while (slotIDIter.MoveNext())
			{
				command.Visit(slotIDIter.Current);
			}
		}
Beispiel #42
0
				public void Accept(IVisitor4 visitor)
				{
					for (int slotChangeIndex = 0; slotChangeIndex < slotChanges.Length; ++slotChangeIndex)
					{
						SlotChange slotChange = slotChanges[slotChangeIndex];
						visitor.Visit(slotChange);
					}
				}
		public void IterateTopLevelClasses(IVisitor4 visitor)
		{
			ClassMetadataIterator i = Iterator();
			while (i.MoveNext())
			{
				ClassMetadata classMetadata = i.CurrentClass();
				if (!classMetadata.IsInternal())
				{
					if (classMetadata.GetAncestor() == null)
					{
						visitor.Visit(classMetadata);
					}
				}
			}
		}
Beispiel #44
0
		public void Traverse(IVisitor4 visitor)
		{
			if (_preceding != null)
			{
				_preceding.Traverse(visitor);
			}
			visitor.Visit((Tree)this);
			if (_subsequent != null)
			{
				_subsequent.Traverse(visitor);
			}
		}
Beispiel #45
0
		public virtual void Hc_traverse(IVisitor4 visitor)
		{
			if (_hcPreceding != null)
			{
				_hcPreceding.Hc_traverse(visitor);
			}
			if (_hcSubsequent != null)
			{
				_hcSubsequent.Hc_traverse(visitor);
			}
			// Traversing the leaves first allows to add ObjectReference 
			// nodes to different ReferenceSystem trees during commit
			visitor.Visit(this);
		}
		protected virtual void Foreach(IExtObjectContainer container, Type clazz, IVisitor4
			 visitor)
		{
			IObjectSet set = NewQuery(container, clazz).Execute();
			while (set.HasNext())
			{
				visitor.Visit(set.Next());
			}
		}
Beispiel #47
0
		public void TraverseKeys(Transaction trans, IVisitor4 visitor)
		{
			ByteArrayBuffer reader = PrepareRead(trans);
			if (_isLeaf)
			{
				for (int i = 0; i < _count; i++)
				{
					object obj = Key(trans, reader, i);
					if (obj != No4.Instance)
					{
						visitor.Visit(obj);
					}
				}
			}
			else
			{
				for (int i = 0; i < _count; i++)
				{
					Child(reader, i).TraverseKeys(trans, visitor);
				}
			}
		}