osgEarth 2.1.1
|
Public Member Functions | |
VirtualFeatureCursor (const FeatureSourceMappingVector &sources, const Query &query) | |
bool | hasMore () const |
Feature * | nextFeature () |
Private Member Functions | |
void | advance () |
Private Attributes | |
FeatureSourceMappingVector | _sources |
Query | _query |
FeatureSourceMappingVector::iterator | _si |
osg::ref_ptr< FeatureCursor > | _si_cursor |
osg::ref_ptr< Feature > | _nextFeature |
osg::ref_ptr< Feature > | _lastFeatureReturned |
Cursor that will iterate over multiple feature sources with predicate filtering
Definition at line 34 of file VirtualFeatureSource.cpp.
anonymous_namespace{VirtualFeatureSource.cpp}::VirtualFeatureCursor::VirtualFeatureCursor | ( | const FeatureSourceMappingVector & | sources, |
const Query & | query | ||
) | [inline] |
void anonymous_namespace{VirtualFeatureSource.cpp}::VirtualFeatureCursor::advance | ( | ) | [inline, private] |
Definition at line 60 of file VirtualFeatureSource.cpp.
{ _nextFeature = 0L; while ( !_nextFeature.valid() ) { // check to see if we are completely done: if ( _si == _sources.end() ) return; // if we're at the beginning, create the first cursor: if ( _si == _sources.begin() && !_si_cursor.valid() ) { _si_cursor = _si->_source->createFeatureCursor( _query ); } while ( !_si_cursor.valid() || !_si_cursor->hasMore() ) { // if the current cursor is done, advance to the next source. // if there is no next source, we are done. if ( ++_si == _sources.end() ) return; // make a cursor for the next source _si_cursor = _si->_source->createFeatureCursor( _query ); } // here, we have a valid cursor with pending data: Feature* f = _si_cursor->nextFeature(); // test against the predicate. (a NULL predicate always accepts the feature) if ( !_si->_predicate.valid() || _si->_predicate->acceptFeature( f ) ) _nextFeature = f; } }
bool anonymous_namespace{VirtualFeatureSource.cpp}::VirtualFeatureCursor::hasMore | ( | ) | const [inline, virtual] |
Implements osgEarth::Features::FeatureCursor.
Definition at line 43 of file VirtualFeatureSource.cpp.
{ return _nextFeature.valid(); }
Feature* anonymous_namespace{VirtualFeatureSource.cpp}::VirtualFeatureCursor::nextFeature | ( | ) | [inline, virtual] |
Implements osgEarth::Features::FeatureCursor.
Definition at line 48 of file VirtualFeatureSource.cpp.
{ _lastFeatureReturned = _nextFeature.get(); _nextFeature = 0L; if ( _lastFeatureReturned.valid() ) advance(); return _lastFeatureReturned.get(); }
osg::ref_ptr<Feature> anonymous_namespace{VirtualFeatureSource.cpp}::VirtualFeatureCursor::_lastFeatureReturned [private] |
Definition at line 102 of file VirtualFeatureSource.cpp.
osg::ref_ptr<Feature> anonymous_namespace{VirtualFeatureSource.cpp}::VirtualFeatureCursor::_nextFeature [private] |
Definition at line 101 of file VirtualFeatureSource.cpp.
Query anonymous_namespace{VirtualFeatureSource.cpp}::VirtualFeatureCursor::_query [private] |
Definition at line 98 of file VirtualFeatureSource.cpp.
FeatureSourceMappingVector::iterator anonymous_namespace{VirtualFeatureSource.cpp}::VirtualFeatureCursor::_si [private] |
Definition at line 99 of file VirtualFeatureSource.cpp.
osg::ref_ptr<FeatureCursor> anonymous_namespace{VirtualFeatureSource.cpp}::VirtualFeatureCursor::_si_cursor [private] |
Definition at line 100 of file VirtualFeatureSource.cpp.
FeatureSourceMappingVector anonymous_namespace{VirtualFeatureSource.cpp}::VirtualFeatureCursor::_sources [private] |
Definition at line 97 of file VirtualFeatureSource.cpp.