Beispiel #1
0
        private bool ConcurrentMoveNext(OsmStreamSource source, out OsmGeo current,
                                        bool ignore_nodes     = false, bool igonre_ways = false,
                                        bool ignore_relations = false)
        {
            bool available = false;

            current = null;

            lock (_source_lock)
            {
                if (_cancel_pull)
                {
                    return(false);
                }

                available = source.MoveNext();

                if (available)
                {
                    current = source.Current();
                    _pull_progress++;
                }
            }

            return(available);
        }
Beispiel #2
0
 /// <summary>
 /// Pulls the next object and returns true if there was one.
 /// </summary>
 /// <returns></returns>
 public bool PullNext()
 {
     if (_source.MoveNext())
     {
         object sourceObject = _source.Current();
         if (sourceObject is Node)
         {
             this.AddNode(sourceObject as Node);
         }
         else if (sourceObject is Way)
         {
             this.AddWay(sourceObject as Way);
         }
         else if (sourceObject is Relation)
         {
             this.AddRelation(sourceObject as Relation);
         }
         return(true);
     }
     return(false);
 }