osgEarth 2.1.1
Public Member Functions | Protected Member Functions | Private Attributes | Friends

osgEarth::Features::FeatureSource Class Reference

Inheritance diagram for osgEarth::Features::FeatureSource:
Collaboration diagram for osgEarth::Features::FeatureSource:

List of all members.

Public Member Functions

 FeatureSource (const ConfigOptions &options=ConfigOptions())
const FeatureProfilegetFeatureProfile () const
const FeatureSourceOptionsgetFeatureSourceOptions () const
virtual FeatureCursorcreateFeatureCursor (const Symbology::Query &query=Symbology::Query())=0
virtual bool isWritable () const
virtual bool deleteFeature (FeatureID fid)
virtual int getFeatureCount () const
virtual FeaturegetFeature (FeatureID fid)
virtual const FeatureSchemagetSchema () const
virtual bool insertFeature (Feature *feature)
virtual Geometry::Type getGeometryType () const
virtual bool hasEmbeddedStyles () const
const FeatureFilterListgetFilters () const
virtual osg::Object * cloneType () const
virtual osg::Object * clone (const osg::CopyOp &) const
virtual bool isSameKindAs (const osg::Object *obj) const
virtual const char * className () const
virtual const char * libraryName () const
virtual void initialize (const std::string &referenceURI)=0

Protected Member Functions

virtual const FeatureProfilecreateFeatureProfile ()=0
virtual ~FeatureSource ()

Private Attributes

const FeatureSourceOptions _options
osg::ref_ptr< const
FeatureProfile
_featureProfile
OpenThreads::Mutex _createMutex

Friends

class Map
class FeatureSourceFactory

Detailed Description

A FeatureSource is a pluggable object that generates Features, and optionally, styling information to go along with them.

Definition at line 88 of file FeatureSource.


Constructor & Destructor Documentation

FeatureSource::FeatureSource ( const ConfigOptions options = ConfigOptions())

Constructs a new feature source with the provided read/write options.

Definition at line 139 of file FeatureSource.cpp.

                                                           :
_options( options )
{    
    //nop
}
virtual osgEarth::Features::FeatureSource::~FeatureSource ( ) [inline, protected, virtual]

DTOR is protected to prevent this object from being allocated on the stack.

Definition at line 207 of file FeatureSource.

{ }

Member Function Documentation

virtual const char* osgEarth::Features::FeatureSource::className ( ) const [inline, virtual]

Reimplemented in osgEarth::Features::FeatureListSource.

Definition at line 186 of file FeatureSource.

{ return "FeatureSource"; }
virtual osg::Object* osgEarth::Features::FeatureSource::clone ( const osg::CopyOp &  ) const [inline, virtual]

Definition at line 184 of file FeatureSource.

{ return 0; } // clone() not appropriate
virtual osg::Object* osgEarth::Features::FeatureSource::cloneType ( ) const [inline, virtual]

Definition at line 183 of file FeatureSource.

{ return 0; } // cloneType() not appropriate
virtual FeatureCursor* osgEarth::Features::FeatureSource::createFeatureCursor ( const Symbology::Query query = Symbology::Query()) [pure virtual]

Creates a cursor that iterates over all the features corresponding to the specified query.

Caller takes ownership of the returned object.

Implemented in OGRFeatureSource, WFSFeatureSource, osgEarth::Features::FeatureListSource, and osgEarth::Features::VirtualFeatureSource.

Here is the caller graph for this function:

virtual const FeatureProfile* osgEarth::Features::FeatureSource::createFeatureProfile ( ) [protected, pure virtual]

Creates and returns a metadata structure describing the features in a named feature class. This method is called by the public function getFeatureProfile() in this same object to create the metadata structure.

Implemented in OGRFeatureSource, WFSFeatureSource, osgEarth::Features::FeatureListSource, and osgEarth::Features::VirtualFeatureSource.

Here is the caller graph for this function:

virtual bool osgEarth::Features::FeatureSource::deleteFeature ( FeatureID  fid) [inline, virtual]

Deletes the feature with the given FID

Returns:
True on success; false on failure or if the source is read-only

Reimplemented in OGRFeatureSource, WFSFeatureSource, and osgEarth::Features::FeatureListSource.

Definition at line 125 of file FeatureSource.

{ return false; }
virtual Feature* osgEarth::Features::FeatureSource::getFeature ( FeatureID  fid) [inline, virtual]

Gets the Feature with the given FID

Returns:
The Feature with the given FID or NULL if not found.

Reimplemented in OGRFeatureSource, WFSFeatureSource, osgEarth::Features::FeatureListSource, and osgEarth::Features::VirtualFeatureSource.

Definition at line 139 of file FeatureSource.

{ return 0L; }
virtual int osgEarth::Features::FeatureSource::getFeatureCount ( ) const [inline, virtual]

Gets the number of features in this FeatureSource

Returns:
The number of features or -1 if the number of features cannot be determined.

Reimplemented in OGRFeatureSource, WFSFeatureSource, and osgEarth::Features::FeatureListSource.

Definition at line 132 of file FeatureSource.

{ return -1; }

Here is the caller graph for this function:

const FeatureProfile * FeatureSource::getFeatureProfile ( ) const

Gets a reference to the metadata that describes features that you can get from this FeatureSource. A valid feature profile indiciates that the feature source successfully initialized.

Definition at line 146 of file FeatureSource.cpp.

{
    if ( !_featureProfile.valid() )
    {
        FeatureSource* nonConstThis = const_cast<FeatureSource*>(this);

        ScopedLock<Mutex> doubleCheckLock( nonConstThis->_createMutex );
        {
            if ( !_featureProfile.valid() )
            {
                // caching pattern                
                nonConstThis->_featureProfile = nonConstThis->createFeatureProfile();
            }
        }
    }
    return _featureProfile.get();
}

Here is the call graph for this function:

Here is the caller graph for this function:

const FeatureSourceOptions& osgEarth::Features::FeatureSource::getFeatureSourceOptions ( ) const [inline]

Gets the options that were passed into this object's CTOR.

Definition at line 106 of file FeatureSource.

{ return _options; }
const FeatureFilterList & FeatureSource::getFilters ( ) const

Accesses the list of feature filters that will transform features before they are returned in a feature cursor.

Definition at line 165 of file FeatureSource.cpp.

{
    return _options.filters();
}

Here is the call graph for this function:

virtual Geometry::Type osgEarth::Features::FeatureSource::getGeometryType ( ) const [inline, virtual]

Gets the Geometry type of the FeatureSource

Returns:
The Geometry type of the FeatureSource

Reimplemented in OGRFeatureSource, WFSFeatureSource, and osgEarth::Features::FeatureListSource.

Definition at line 159 of file FeatureSource.

Here is the caller graph for this function:

const FeatureSchema & FeatureSource::getSchema ( ) const [virtual]

Gets the FeatureSchema for this FeatureSource. If the schema doesn't publish a source, this might be empty.

Reimplemented in OGRFeatureSource, WFSFeatureSource, and osgEarth::Features::VirtualFeatureSource.

Definition at line 171 of file FeatureSource.cpp.

{
    static FeatureSchema s_emptySchema;
    return s_emptySchema;
}

Here is the caller graph for this function:

virtual bool osgEarth::Features::FeatureSource::hasEmbeddedStyles ( ) const [inline, virtual]

Returns true if this source creates features with embedded style information. By default, this is false (features are not expected to carry their own style definitions).

Reimplemented in osgEarth::Features::FeatureListSource.

Definition at line 169 of file FeatureSource.

                                               {
            return false; }
virtual void osgEarth::Features::FeatureSource::initialize ( const std::string &  referenceURI) [pure virtual]

Initialize the FeatureSource. The profile should be computed and set here using setProfile()

Implemented in OGRFeatureSource, WFSFeatureSource, osgEarth::Features::FeatureListSource, and osgEarth::Features::VirtualFeatureSource.

virtual bool osgEarth::Features::FeatureSource::insertFeature ( Feature feature) [inline, virtual]

Inserts the given feature into the FeatureSource

Returns:
True if the feature was inserted, false if not

Reimplemented in OGRFeatureSource, WFSFeatureSource, and osgEarth::Features::FeatureListSource.

Definition at line 152 of file FeatureSource.

{ return false; }
virtual bool osgEarth::Features::FeatureSource::isSameKindAs ( const osg::Object *  obj) const [inline, virtual]

Definition at line 185 of file FeatureSource.

{ return dynamic_cast<const FeatureSource*>(obj)!=NULL; }
virtual bool osgEarth::Features::FeatureSource::isWritable ( ) const [inline, virtual]

Whether this FeatureSource supports inserting and deleting features

Reimplemented in OGRFeatureSource, WFSFeatureSource, and osgEarth::Features::FeatureListSource.

Definition at line 119 of file FeatureSource.

{ return false; }
virtual const char* osgEarth::Features::FeatureSource::libraryName ( ) const [inline, virtual]

Reimplemented in osgEarth::Features::FeatureListSource.

Definition at line 187 of file FeatureSource.

{ return "osgEarthFeatures"; }

Friends And Related Function Documentation

friend class FeatureSourceFactory [friend]

Definition at line 216 of file FeatureSource.

friend class Map [friend]

Definition at line 215 of file FeatureSource.


Member Data Documentation

Definition at line 213 of file FeatureSource.

Definition at line 212 of file FeatureSource.

Reimplemented in OGRFeatureSource, and WFSFeatureSource.

Definition at line 210 of file FeatureSource.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines