BFeaturesOnDisk Class Reference

#include <BFeaturesOnDisk.h>

Inheritance diagram for BFeaturesOnDisk:

Inheritance graph
[legend]

List of all members.


Detailed Description

A collection of BFeature objects that exists on a disk.

Public Member Functions

virtual void Add (const BFeatureCollection &features)
 Appends the BFeature objects in the specified collection to this collection.
virtual void Add (const BFeaturePtr &feature)
 Adds a BFeature to this collection.
virtual void Add (const BFeature &feature)
 Copies the specified BFeature and adds it to this collection.
 BFeaturesOnDisk (const BFeaturesOnDisk &feats)
 Copy constructor.
 BFeaturesOnDisk (const BString &cacheName, Int32 pageSize)
 Constructor.
 BFeaturesOnDisk ()
 Default constructor.
virtual void Clear (void)
 Removes all BFeature objects from this collection.
virtual const BFeaturePtr GetAt (size_t index, bool inclCachedAttrs=true) const
 Gets the BFeature at the specified index in this collection.
virtual BFeaturePtr GetAt (size_t index, bool inclCachedAttrs=true)
 Gets the BFeature at the specified index in this collection.
virtual size_t GetCount (void) const
 Gets the number of BFeature objects in this collection.
virtual void Release (size_t index)
 Releases the memory associated with a BFeature.
virtual void Remove (size_t index)
 Removes a BFeature from this collection.
virtual void Reserve (size_t size)
 Reserves space for the requested number of elements in this collection.
virtual void Transform (const BTransform &cst)
 Transforms the geometry of each BFeature in this collection to a different coordinate system.
virtual void TransformReverse (const BTransform &cst)
 Transforms the geometry of each BFeature in this collection to a different coordinate system using the "reverse" of the BTransform.
virtual ~BFeaturesOnDisk ()
 Destructor.

Protected Member Functions

BRect ComputeMBR (void) const
 Computes the minimum bounding rectangle for the BFeature objects in this collection.
BFeaturePtr ReadFeatureFromCache (Int32 id, bool inclAttrs) const
 Reads a BFeature from the BDiskCache.
void RemoveFeatureFromCache (Int32 id)
 Removes a BFeature from the BDiskCache.
void ReplaceFeatureInCache (Int32 id, BFeature &feature)
 Replace a BFeature in the BDiskCache.
Int32 WriteFeatureToCache (const BFeature &feature)
 Writes a BFeature to the BDiskCache.

Protected Attributes

BString m_cacheName
 The base file name for the cache.
Int32Vector m_featureIDs
 The feature ID index.
Int32 m_pageSize
 The page size for the cache.
BDiskCachePtr m_pCache
 The BDiskCache that holds the data for this collection.

Constructor & Destructor Documentation

BFeaturesOnDisk (  ) 

Default constructor.

This constructor will create an empty collection.

BFeaturesOnDisk ( const BString cacheName,
Int32  pageSize 
)

Constructor.

This constructor will create an empty collection that uses the specified cache.

Parameters:
cacheName The base file name to be used for the cache. If an empty string is specified, a temporary file name will be generated.
pageSize The page size to be used in the cache.

BFeaturesOnDisk ( const BFeaturesOnDisk feats  ) 

Copy constructor.

Parameters:
feats The BFeaturesOnDisk object to copy.

virtual ~BFeaturesOnDisk (  )  [inline, virtual]

Destructor.


Member Function Documentation

virtual void Add ( const BFeatureCollection features  )  [virtual]

Appends the BFeature objects in the specified collection to this collection.

Parameters:
features The collection of BFeature objects to be added.
Exceptions:
BUnknownGeometryException This exception will be thrown if the geometry associated with the specified feature is not of the correct class.

Implements BFeatureCollection.

virtual void Add ( const BFeaturePtr feature  )  [virtual]

Adds a BFeature to this collection.

Parameters:
feature Pointer to the feature to be added.
Exceptions:
BUnknownGeometryException This exception will be thrown if the geometry associated with the specified feature is not of the correct class.

Implements BFeatureCollection.

virtual void Add ( const BFeature feature  )  [virtual]

Copies the specified BFeature and adds it to this collection.

Parameters:
feature The BFeature to be copied and added to this collection.
Exceptions:
BUnknownGeometryException This exception will be thrown if the geometry associated with the specified feature is not of the correct class.

Implements BFeatureCollection.

virtual void Clear ( void   )  [virtual]

Removes all BFeature objects from this collection.

Derived classes should call Clear method in the base class implementation.

Reimplemented from BFeatureCollection.

BRect ComputeMBR ( void   )  const [protected, virtual]

Computes the minimum bounding rectangle for the BFeature objects in this collection.

Returns:
The minimum bounding rectangle.

Implements BFeatureCollection.

virtual const BFeaturePtr GetAt ( size_t  index,
bool  inclCachedAttrs = true 
) const [virtual]

Gets the BFeature at the specified index in this collection.

Parameters:
index The zero-based index of the desired BFeature.
inclCachedAttrs Indicates whether the returned feature will contain attributes. This applies only when the features are stored in a disk cache, and can be used to improve performance in applications where attributes are not needed. If the features are stored in memory, this has no effect.
Returns:
The BFeature at the specified index.
Exceptions:
BIndexOutOfBoundsException This exception will be thrown if the specified index does not correspond to a BFeature in this collection.

Implements BFeatureCollection.

virtual BFeaturePtr GetAt ( size_t  index,
bool  inclCachedAttrs = true 
) [virtual]

Gets the BFeature at the specified index in this collection.

Parameters:
index The zero-based index of the desired BFeature.
inclCachedAttrs Indicates whether the returned feature will contain attributes. This applies only when the features are stored in a disk cache, and can be used to improve performance in applications where attributes are not needed. If the features are stored in memory, this has no effect.
Returns:
The BFeature at the specified index.
Exceptions:
BIndexOutOfBoundsException This exception will be thrown if the specified index does not correspond to a BFeature in this collection.

Implements BFeatureCollection.

virtual size_t GetCount ( void   )  const [inline, virtual]

Gets the number of BFeature objects in this collection.

Returns:
The number of BFeature objects in this collection.

Implements BFeatureCollection.

BFeaturePtr ReadFeatureFromCache ( Int32  id,
bool  inclAttrs 
) const [protected]

Reads a BFeature from the BDiskCache.

Parameters:
id The ID for the BFeature to read from the BDiskCache.
inclAttrs Indicates whether or not to include the attributes when reading a feature from the cache.
Returns:
The BFeature object.

virtual void Release ( size_t  index  )  [inline, virtual]

Releases the memory associated with a BFeature.

This method has no effect on features stored in the disk cache.

Parameters:
index The zero-based index of the BFeature to be released.

Implements BFeatureCollection.

virtual void Remove ( size_t  index  )  [virtual]

Removes a BFeature from this collection.

Parameters:
index The zero-based index of the BFeature to be removed.
Exceptions:
BIndexOutOfBoundsException This exception will be thrown if the specified index does not correspond to a BFeature in this collection.

Implements BFeatureCollection.

void RemoveFeatureFromCache ( Int32  id  )  [protected]

Removes a BFeature from the BDiskCache.

Parameters:
id The ID of the BFeature to be removed.

void ReplaceFeatureInCache ( Int32  id,
BFeature feature 
) [protected]

Replace a BFeature in the BDiskCache.

Parameters:
id The id of the BFeature to be replaced.
feature The BFeature object that will be written to the BDiskCache.

virtual void Reserve ( size_t  size  )  [inline, virtual]

Reserves space for the requested number of elements in this collection.

Parameters:
size The number of elements for which space shall be reserved.

Implements BFeatureCollection.

virtual void Transform ( const BTransform cst  )  [virtual]

Transforms the geometry of each BFeature in this collection to a different coordinate system.

Parameters:
cst The BTransform that defines the transformation.

Implements BFeatureCollection.

virtual void TransformReverse ( const BTransform cst  )  [virtual]

Transforms the geometry of each BFeature in this collection to a different coordinate system using the "reverse" of the BTransform.

Parameters:
cst The BTransform that defines the transformation.

Implements BFeatureCollection.

Int32 WriteFeatureToCache ( const BFeature feature  )  [protected]

Writes a BFeature to the BDiskCache.

Parameters:
feature The BFeature to be written to the BDiskCache.
Returns:
The BFeature's cache ID, which will be used to read the BFeature out of the BDiskCache.


Member Data Documentation

BString m_cacheName [protected]

The base file name for the cache.

Int32Vector m_featureIDs [protected]

The feature ID index.

Int32 m_pageSize [protected]

The page size for the cache.

BDiskCachePtr m_pCache [protected]

The BDiskCache that holds the data for this collection.


The documentation for this class was generated from the following file:

GeoTranslate 5.0 From Blue Marble Geographics