BAggregate Class Template Reference

#include <BAggregate.h>

Inheritance diagram for BAggregate:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class T>
class GeoCore::BAggregate< T >

Template interface representing an aggregate of BGeometry objects.

The class specified in the template must be an instance of a boost::shared_ptr, where the class wrapped by the smart pointer is derived from BGeometry.

Public Member Functions

void ApplyTransform (const BTransform &cst)
 Transforms the BGeometry objects in this BAggregate.
void ApplyTransformReverse (const BTransform &cst)
 Transforms the BGeometry objects in the collection using the "reverse" of the BTransform.
 BAggregate (const BAggregate< T > &aggy)
 Copy constructor.
 BAggregate (EGeometryClass cl)
 Creates an empty BAggregate of BGeometry objects and restricts the class of geometries that can be contained in this BAggregate.
 BAggregate ()
 Default constructor.
void Clear (void)
 Removes all BGeometry objects from this BAggregate.
const T & GetAt (size_t index) const
 Gets the BGeometry at the specified index.
T & GetAt (size_t index)
 Gets the BGeometry at the specified index.
size_t GetCount (void) const
 Gets the number of BGeometry objects in this BAggregate.
EGeometryClass GetRestriction (void) const
 Gets the geometry class to which the BGeometry objects are restricted.
bool IsRestricted (void) const
 Indicates whether or not the BGeometry objects in this BAggregate are restricted to a particular class.
void Reserve (size_t count)
 Reserves space in the collection for the specified number of objects.

Protected Member Functions

void AggyAdd (const BAggregate< T > &aggy)
 Adds a collection of BGeometry objects to this BAggregate.
void AggyAdd (const T &pGeo)
 Adds a BGeometry to the collection.
size_t AggyComputeSize (void) const
 Computes the size of the BByteArray required to store this object.
void AggyFromByteArray (const BByteArray &bytes, size_t &startPos)
 Initializes an instance of this object from a BByteArray.
void AggyRemove (const T &pGeo)
 Removes a BGeometry from this BAggregate.
BByteArray AggyToByteArray (void) const
 Stores this object in a BByteArray.

Protected Attributes

std::vector< T > m_geometries
 The collection of BGeometry objects.
EGeometryClass m_restriction
 All BGeometry objects must be part of this geometry class.


Constructor & Destructor Documentation

BAggregate (  )  [inline]

Default constructor.

Creates an empty BAggregate of BGeometry objects with no restriction on the geometry class.

BAggregate ( EGeometryClass  cl  )  [inline]

Creates an empty BAggregate of BGeometry objects and restricts the class of geometries that can be contained in this BAggregate.

Parameters:
cl The class of geometries that can be contained in this BAggregate.

BAggregate ( const BAggregate< T > &  aggy  )  [inline]

Copy constructor.

Parameters:
aggy The BAggregate to copy


Member Function Documentation

void AggyAdd ( const BAggregate< T > &  aggy  )  [inline, protected]

Adds a collection of BGeometry objects to this BAggregate.

Parameters:
aggy The collection of BGeometries.
Exceptions:
BUnknownGeometryException This exception will be thrown if this BAggregate is restricted to containing a geometry class that is different from the geometry class of the BGeometry being added.

void AggyAdd ( const T &  pGeo  )  [inline, protected]

Adds a BGeometry to the collection.

Parameters:
pGeo The BGeometry to add to the collection.
Exceptions:
BUnknownGeometryException This exception will be thrown if this BAggregate is restricted to containing a geometry class that is different from the geometry class of the BGeometry being added.

size_t AggyComputeSize ( void   )  const [inline, protected]

Computes the size of the BByteArray required to store this object.

Returns:
The size of the BByteArray.

void AggyFromByteArray ( const BByteArray bytes,
size_t &  startPos 
) [inline, protected]

Initializes an instance of this object from a BByteArray.

Parameters:
bytes The BByteArray containing the byte representation for this object.
startPos The position in the BByteArray where the byte representation begins. This value will be updated to point to the byte past the end of this object in the byte array.

void AggyRemove ( const T &  pGeo  )  [inline, protected]

Removes a BGeometry from this BAggregate.

Parameters:
pGeo The BGeometry to remove from the collection.

BByteArray AggyToByteArray ( void   )  const [inline, protected]

Stores this object in a BByteArray.

Returns:
A BByteArray that stores the contents of this object.

void ApplyTransform ( const BTransform cst  )  [inline]

Transforms the BGeometry objects in this BAggregate.

Parameters:
cst The BTransform to apply to each BGeometry.

void ApplyTransformReverse ( const BTransform cst  )  [inline]

Transforms the BGeometry objects in the collection using the "reverse" of the BTransform.

Parameters:
cst The BTransform to apply to each BGeometry.

void Clear ( void   )  [inline]

Removes all BGeometry objects from this BAggregate.

const T& GetAt ( size_t  index  )  const [inline]

Gets the BGeometry at the specified index.

Parameters:
index The index.
Returns:
The BGeometry at the specified index.
Exceptions:
BException This exception will be thrown if there does not exist an element at the specified index.

T& GetAt ( size_t  index  )  [inline]

Gets the BGeometry at the specified index.

Parameters:
index The zero-based index.
Returns:
The BGeometry at the specified index.
Exceptions:
BException This exception will be thrown if there does not exist an element at the specified index.

size_t GetCount ( void   )  const [inline]

Gets the number of BGeometry objects in this BAggregate.

Returns:
The number of BGeometry objects in this BAggregate.

EGeometryClass GetRestriction ( void   )  const [inline]

Gets the geometry class to which the BGeometry objects are restricted.

Returns:
The class of geometries that can be contained in this BAggregate.

bool IsRestricted ( void   )  const [inline]

Indicates whether or not the BGeometry objects in this BAggregate are restricted to a particular class.

Returns:
True if there is a restriction, and False otherwise.

void Reserve ( size_t  count  )  [inline]

Reserves space in the collection for the specified number of objects.

Parameters:
count The number of objects to reserve space for.


Member Data Documentation

std::vector<T> m_geometries [protected]

The collection of BGeometry objects.

EGeometryClass m_restriction [protected]

All BGeometry objects must be part of this geometry class.

If the class is eClassNone, then there is no restriction on the geometries.


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

GeoTranslate 5.0 From Blue Marble Geographics