te::mem::DataSet Class Reference

Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver. More...

#include <DataSet.h>

Inheritance diagram for te::mem::DataSet:
te::da::DataSet

Public Member Functions

void add (DataSetItem *item)
 It adds a new item to the dataset and takes its ownership. More...
 
void add (const std::string &propertyName, std::size_t propertyType, const te::dt::AbstractData *defaultValue=0)
 It adds a new property to the dataset schema and fills this new property with a default value. More...
 
void clear ()
 It clears all the dataset items. More...
 
void copy (te::da::DataSet &src, std::size_t limit=0)
 It copies up to limit items from the source dataset. More...
 
void copy (te::da::DataSet &src, const std::vector< std::size_t > &properties, std::size_t limit=0)
 It copies up to limit items from the source dataset (src). More...
 
 DataSet (const te::da::DataSetType *const dt)
 It constructs an empty dataset having the schema dt. More...
 
 DataSet (te::da::DataSet &rhs)
 Regular copy constructor. More...
 
 DataSet (const DataSet &rhs, const bool deepCopy=false)
 It creates a new In-Memory dataset with the items from the rhs dataset. More...
 
 DataSet (te::da::DataSet &rhs, const std::vector< std::size_t > &properties, std::size_t limit=0)
 Copy constructor with property restriction. More...
 
void drop (std::size_t pos)
 It drops a property from the dataset. More...
 
void remove ()
 It removes the current dataset item. More...
 
void remove (DataSetItem *item)
 It removes a specific dataset item. More...
 
void update (te::dt::Property *prop)
 It update a property from the dataset. More...
 
 ~DataSet ()
 Destructor. More...
 
DataSet inherited methods
te::common::TraverseType getTraverseType () const
 It returns the traverse type associated to the dataset. More...
 
te::common::AccessPolicy getAccessPolicy () const
 It returns the read and write permission associated to the dataset. More...
 
std::size_t getNumProperties () const
 It returns the number of properties that composes an item of the dataset. More...
 
int getPropertyDataType (std::size_t pos) const
 It returns the underlying data type of the property at position pos. More...
 
void setPropertyDataType (int dt, std::size_t pos)
 
std::string getPropertyName (std::size_t pos) const
 It returns the property name at position pos. More...
 
void setPropertyName (const std::string &name, std::size_t pos)
 
std::string getDatasetNameOfProperty (std::size_t pos) const
 It returns the underlying dataset name of the property at position pos. More...
 
DataSetItemgetItem () const
 
bool isEmpty () const
 It returns true if the collection is empty. More...
 
bool isConnected () const
 It returns true if the dataset is connected and false if it is disconnected. A dataset can be connected or disconnected. A connected dataset, after its creation through the data source transactor, continues to depend on the connection given by its associated data source. Differently, a disconnected dataset, after its creation, no more depends of the connection given by the data source, and it continues to live after the connection has been released to the data source. More...
 
std::size_t size () const
 It returns the collection size, if it is known. More...
 
std::auto_ptr< te::gm::EnvelopegetExtent (std::size_t i)
 It computes the bounding rectangle for a spatial property of the dataset. More...
 
bool moveNext ()
 It moves the internal pointer to the next item of the collection. More...
 
bool movePrevious ()
 It moves the internal pointer to the previous item of the collection. More...
 
bool moveBeforeFirst ()
 It moves the internal pointer to a position before the first item in the collection. More...
 
bool moveFirst ()
 It moves the internal pointer to the first item in the collection. More...
 
bool moveLast ()
 It sets the dataset internal pointer to the last item in the collection. More...
 
bool move (std::size_t i)
 It moves the dataset internal pointer to a given position. More...
 
bool isAtBegin () const
 It tells if the dataset internal pointer is on the first element of the collection or not. More...
 
bool isBeforeBegin () const
 It tells if the dataset internal pointer is in a position before the first element of the collection or not. More...
 
bool isAtEnd () const
 It tells if the dataset internal pointer is on the last element of the collection. More...
 
bool isAfterEnd () const
 It tells if the dataset internal pointer is on the sentinel position after the last element of the collection or not. More...
 
char getChar (std::size_t i) const
 Method for retrieving a signed character attribute value (1 byte long). More...
 
unsigned char getUChar (std::size_t i) const
 Method for retrieving an unsigned character attribute value (1 byte long). More...
 
boost::int16_t getInt16 (std::size_t i) const
 Method for retrieving a 16-bit integer attribute value (2 bytes long). More...
 
boost::int32_t getInt32 (std::size_t i) const
 Method for retrieving a 32-bit integer attribute value (4 bytes long). More...
 
boost::int64_t getInt64 (std::size_t i) const
 Method for retrieving a 64-bit integer attribute value (8 bytes long). More...
 
bool getBool (std::size_t i) const
 Method for retrieving a boolean attribute value. More...
 
float getFloat (std::size_t i) const
 Method for retrieving a float attribute value. More...
 
double getDouble (std::size_t i) const
 Method for retrieving a double attribute value. More...
 
std::string getNumeric (std::size_t i) const
 Method for retrieving a numeric attribute value. More...
 
std::string getString (std::size_t i) const
 Method for retrieving a string value attribute. More...
 
std::auto_ptr< te::dt::ByteArraygetByteArray (std::size_t i) const
 Method for retrieving a byte array. More...
 
std::auto_ptr< te::gm::GeometrygetGeometry (std::size_t i) const
 Method for retrieving a geometric attribute value. More...
 
std::auto_ptr< te::rst::RastergetRaster (std::size_t i) const
 Method for retrieving a raster attribute value. More...
 
std::auto_ptr< te::dt::DateTimegetDateTime (std::size_t i) const
 Method for retrieving a date and time attribute value. More...
 
std::auto_ptr< te::dt::ArraygetArray (std::size_t i) const
 Method for retrieving an array. More...
 
std::auto_ptr< te::dt::AbstractDatagetValue (std::size_t i) const
 Method for retrieving any other type of data value stored in the data source. More...
 
bool isNull (std::size_t i) const
 It checks if the attribute value is NULL. More...
 
Methods to set values to the DataSet

These methods will take the ownership of the given pointers.

void setChar (std::size_t i, char value)
 
void setChar (const std::string &name, char value)
 
void setUChar (std::size_t i, unsigned char value)
 
void setUChar (const std::string &name, unsigned char value)
 
void setInt16 (std::size_t i, boost::int16_t value)
 
void setInt16 (const std::string &name, boost::int16_t value)
 
void setInt32 (std::size_t i, boost::int32_t value)
 
void setInt32 (const std::string &name, boost::int32_t value)
 
void setInt64 (std::size_t i, boost::int64_t value)
 
void setInt64 (const std::string &name, boost::int64_t value)
 
void setBool (std::size_t i, bool value)
 
void setBool (const std::string &name, bool value)
 
void setFloat (std::size_t i, float value)
 
void setFloat (const std::string &name, float value)
 
void setDouble (std::size_t i, double value)
 
void setDouble (const std::string &name, double value)
 
void setNumeric (std::size_t i, const std::string &value)
 
void setNumeric (const std::string &name, const std::string &value)
 
void setString (std::size_t i, const std::string &value)
 
void setString (const std::string &name, const std::string &value)
 
void setByteArray (std::size_t i, te::dt::ByteArray *value)
 
void setByteArray (const std::string &name, te::dt::ByteArray *value)
 
void setGeometry (std::size_t i, te::gm::Geometry *value)
 
void setGeometry (const std::string &name, te::gm::Geometry *value)
 
void setRaster (std::size_t i, te::rst::Raster *value)
 
void setRaster (const std::string &name, te::rst::Raster *value)
 
void setDateTime (std::size_t i, te::dt::DateTime *value)
 
void setDateTime (const std::string &name, te::dt::DateTime *value)
 
void setValue (std::size_t i, te::dt::AbstractData *value)
 
void setValue (const std::string &name, te::dt::AbstractData *ad)
 
DataSet Element Properties

Methods for retrieving/setting the dataset item component values without the need to explicitly instantiate an item via getItem method.

virtual char getChar (const std::string &name) const
 Method for retrieving a signed character attribute value (1 byte long). More...
 
virtual unsigned char getUChar (const std::string &name) const
 Method for retrieving an unsigned character attribute value (1 byte long). More...
 
virtual boost::int16_t getInt16 (const std::string &name) const
 Method for retrieving a 16-bit integer attribute value (2 bytes long). More...
 
virtual boost::int32_t getInt32 (const std::string &name) const
 Method for retrieving a 32-bit integer attribute value (4 bytes long). More...
 
virtual boost::int64_t getInt64 (const std::string &name) const
 Method for retrieving a 64-bit integer attribute value (8 bytes long). More...
 
virtual bool getBool (const std::string &name) const
 Method for retrieving a boolean attribute value. More...
 
virtual float getFloat (const std::string &name) const
 Method for retrieving a float attribute value. More...
 
virtual double getDouble (const std::string &name) const
 Method for retrieving a double attribute value. More...
 
virtual std::string getNumeric (const std::string &name) const
 Method for retrieving a numeric attribute value. More...
 
virtual std::string getString (const std::string &name) const
 Method for retrieving a string attribute value. More...
 
virtual std::auto_ptr< te::dt::ByteArraygetByteArray (const std::string &name) const
 Method for retrieving a byte array. More...
 
virtual std::auto_ptr< te::gm::GeometrygetGeometry (const std::string &name) const
 Method for retrieving a geometric attribute value. More...
 
virtual std::auto_ptr< te::rst::RastergetRaster (const std::string &name) const
 Method for retrieving a raster attribute value. More...
 
virtual std::auto_ptr< te::dt::DateTimegetDateTime (const std::string &name) const
 Method for retrieving a date and time attribute value. More...
 
virtual std::auto_ptr< te::dt::ArraygetArray (const std::string &name) const
 Method for retrieving an array. More...
 
virtual std::auto_ptr< te::dt::AbstractDatagetValue (const std::string &name) const
 Method for retrieving any other type of data value stored in the data source. More...
 
virtual std::string getAsString (std::size_t i, int precision=0) const
 Method for retrieving a data value as a string plain representation. More...
 
virtual std::string getAsString (const std::string &name, int precision=0) const
 Method for retrieving a data value as a string plain representation. More...
 
virtual bool isNull (const std::string &name) const
 It checks if the attribute value is NULL. More...
 

Protected Attributes

int m_i
 The index of the current item. More...
 
boost::shared_ptr< boost::ptr_vector< DataSetItem > > m_items
 The list of dataset items. More...
 
std::vector< std::string > m_pnames
 The list of property names. More...
 
std::vector< int > m_ptypes
 The list of property types. More...
 

Detailed Description

Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver.

See also
te::da::DataSet

Definition at line 65 of file DataSet.h.

Constructor & Destructor Documentation

te::mem::DataSet::DataSet ( const te::da::DataSetType *const  dt)
explicit

It constructs an empty dataset having the schema dt.

Parameters
dtThe DataSetType associated to the dataset.
Note
The dataset will NOT take the ownership of the given DataSetType.
te::mem::DataSet::DataSet ( te::da::DataSet rhs)

Regular copy constructor.

It creates a new In-Memory dataset with the items from the rhs dataset.

Parameters
rhsThe dataset which will provide the items.
Precondition
You must assure that rhs is in a valid item to be read.
Note
This constructor will use the method "moveNext()" of the source dataset (rhs) in order to read its dataset items. It will start reading the given dataset in the current position. So, the caller is responsible for informing the dataset in the right position to start processing it.
The new dataset will not have a transactor associated to it.
te::mem::DataSet::DataSet ( const DataSet rhs,
const bool  deepCopy = false 
)
explicit

It creates a new In-Memory dataset with the items from the rhs dataset.

Parameters
rhsThe dataset which will provide the items to copy from.
deepCopyIf true the new dataset instance will clone all dataset items from the source dataset (rhs), otherwise it will share all items.
Note
The new dataset will not have a transactor associated to it.
te::mem::DataSet::DataSet ( te::da::DataSet rhs,
const std::vector< std::size_t > &  properties,
std::size_t  limit = 0 
)

Copy constructor with property restriction.

It creates a new memory data set with items from a source dataset (rhs) considering just some properties.

Parameters
rhsThe data set whose data set items will be copied.
propertiesThe list of properties which will be considered in the copy.
limitThe number of items to be copied. Use 0 to copy all items.
Precondition
The properties in the property vector must come from the source dataset (rhs) schema. In other words, they must be valid pointers in the rhs dataset type.
Note
This constructor will use the method "moveNext()" of the given data set in order to read its dataset items. It will start reading the given dataset in the current position. So, the caller is responsible for informing the dataset in the right position to start processing it.
The dataset will NOT take the ownership of the given properties, internally it will clone them.
te::mem::DataSet::~DataSet ( )
virtual

Destructor.

Reimplemented from te::da::DataSet.

Member Function Documentation

void te::mem::DataSet::add ( DataSetItem item)

It adds a new item to the dataset and takes its ownership.

Parameters
itemThe item to be added to the dataset.
Precondition
The item schema must be compatible with the dataset items.
Note
In-Memory driver extended method.
void te::mem::DataSet::add ( const std::string &  propertyName,
std::size_t  propertyType,
const te::dt::AbstractData defaultValue = 0 
)

It adds a new property to the dataset schema and fills this new property with a default value.

Parameters
propThe new property that will be created. The dataset will take its ownership.
defaultValueThe default value that will be used to fill the new property values. May be a NULL value.
Note
The DataSet will NOT take the ownership of the informed default value.
In-Memory driver extended method.
void te::mem::DataSet::clear ( )

It clears all the dataset items.

void te::mem::DataSet::copy ( te::da::DataSet src,
std::size_t  limit = 0 
)

It copies up to limit items from the source dataset.

Parameters
srcThe source dataset with the items that will be copied.
limitThe number of items to be copied. Use 0 to copy all items.
Note
This method will call moveNext() for the source dataset in order to read its items. It will start reading the given dataset in the current position. So, the caller is responsible for informing the dataset in the right position to start processing it.
In-Memory driver extended method.
void te::mem::DataSet::copy ( te::da::DataSet src,
const std::vector< std::size_t > &  properties,
std::size_t  limit = 0 
)

It copies up to limit items from the source dataset (src).

Parameters
srcThe source dataset with the items that will be copied.
propertiesThe list of properties which will be considered in the copy.
limitThe number of items to be copied. Use 0 to copy all items.
Precondition
The properties in the property vector must come from the source dataset (rhs) schema. In other words, they must be valid pointers in the rhs dataset type.
Note
This method will call moveNext() for the source dataset in order to read its items. It will start reading the given dataset in the current position. So, the caller is responsible for informing the dataset in the right position to start processing it.
In-Memory driver extended method.
void te::mem::DataSet::drop ( std::size_t  pos)

It drops a property from the dataset.

Parameters
propThe property that will be dropped.
Note
The Property will be destroyed.
In-Memory driver extended method.
te::common::AccessPolicy te::mem::DataSet::getAccessPolicy ( ) const
virtual

It returns the read and write permission associated to the dataset.

Returns
The read and write permission associated to the dataset.

Implements te::da::DataSet.

std::auto_ptr<te::dt::Array> te::mem::DataSet::getArray ( std::size_t  i) const
virtual

Method for retrieving an array.

Parameters
iThe attribute index.

Implements te::da::DataSet.

virtual std::auto_ptr<te::dt::Array> te::da::DataSet::getArray ( const std::string &  name) const
virtualinherited

Method for retrieving an array.

Parameters
nameThe attribute name.
Returns
An array. The caller will take its ownership.

Reimplemented in te::gdal::DataSet.

virtual std::string te::da::DataSet::getAsString ( std::size_t  i,
int  precision = 0 
) const
virtualinherited

Method for retrieving a data value as a string plain representation.

Parameters
iThe attribute index.
precisionThe precision in the conversion.
Returns
The attribute value in a string format.
Note
It is safe to call this method for any data type, the data source implementation will take care of how to convert the internal representation to a string.
virtual std::string te::da::DataSet::getAsString ( const std::string &  name,
int  precision = 0 
) const
virtualinherited

Method for retrieving a data value as a string plain representation.

Parameters
nameThe attribute name.
precisionThe precision in the conversion.
Returns
The attribute value in a string format.
Note
It is safe to call this method for any data type, the data source implementation will take care of how to convert the internal representation to a string.
bool te::mem::DataSet::getBool ( std::size_t  i) const
virtual

Method for retrieving a boolean attribute value.

Parameters
iThe attribute index.
Returns
The boolean attribute value in the given position.

Implements te::da::DataSet.

virtual bool te::da::DataSet::getBool ( const std::string &  name) const
virtualinherited

Method for retrieving a boolean attribute value.

Parameters
nameThe attribute name.
Returns
The boolean attribute value with the given name.

Reimplemented in te::gdal::DataSet.

std::auto_ptr<te::dt::ByteArray> te::mem::DataSet::getByteArray ( std::size_t  i) const
virtual

Method for retrieving a byte array.

You can use this method in order to retrieve a BLOB data.

Parameters
iThe attribute index.
Returns
The byte array attribute.

Implements te::da::DataSet.

virtual std::auto_ptr<te::dt::ByteArray> te::da::DataSet::getByteArray ( const std::string &  name) const
virtualinherited

Method for retrieving a byte array.

You can use this method in order to retrieve a BLOB data.

Parameters
nameThe attribute name.
Returns
The byte array attribute.

Reimplemented in te::gdal::DataSet.

char te::mem::DataSet::getChar ( std::size_t  i) const
virtual

Method for retrieving a signed character attribute value (1 byte long).

Parameters
iThe attribute index.
Returns
The signed character attribute value (1 byte long) in the given position.

Implements te::da::DataSet.

virtual char te::da::DataSet::getChar ( const std::string &  name) const
virtualinherited

Method for retrieving a signed character attribute value (1 byte long).

Parameters
nameThe attribute name.
Returns
The signed character attribute value (1 byte long) with the given name.

Reimplemented in te::gdal::DataSet.

std::string te::mem::DataSet::getDatasetNameOfProperty ( std::size_t  i) const
virtual

It returns the underlying dataset name of the property at position pos.

Parameters
iThe property position of interest.
Returns
The underlying dataset name of the property at position pos.

Implements te::da::DataSet.

std::auto_ptr<te::dt::DateTime> te::mem::DataSet::getDateTime ( std::size_t  i) const
virtual

Method for retrieving a date and time attribute value.

Parameters
iThe attribute index.
Returns
The date and time attribute value in the given position.

Implements te::da::DataSet.

virtual std::auto_ptr<te::dt::DateTime> te::da::DataSet::getDateTime ( const std::string &  name) const
virtualinherited

Method for retrieving a date and time attribute value.

Parameters
nameThe attribute name.
Returns
The date and time attribute value with the given name.

Reimplemented in te::gdal::DataSet.

double te::mem::DataSet::getDouble ( std::size_t  i) const
virtual

Method for retrieving a double attribute value.

Parameters
iThe attribute index.
Returns
The double attribute value in the given position.

Implements te::da::DataSet.

virtual double te::da::DataSet::getDouble ( const std::string &  name) const
virtualinherited

Method for retrieving a double attribute value.

Parameters
nameThe attribute name.
Returns
The double attribute value with the given name.

Reimplemented in te::gdal::DataSet.

std::auto_ptr<te::gm::Envelope> te::mem::DataSet::getExtent ( std::size_t  i)
virtual

It computes the bounding rectangle for a spatial property of the dataset.

Parameters
iThe position of a spatial property to get its bounding box.
Precondition
The position i must be associated to a spatial property of the dataset.
Exceptions
ExceptionIt throws an exception if something goes wrong during MBR search.
Returns
The spatial property bounding rectangle, or an invalid box, if none is found.

Implements te::da::DataSet.

float te::mem::DataSet::getFloat ( std::size_t  i) const
virtual

Method for retrieving a float attribute value.

Parameters
iThe attribute index.
Returns
The float attribute value in the given position.

Implements te::da::DataSet.

virtual float te::da::DataSet::getFloat ( const std::string &  name) const
virtualinherited

Method for retrieving a float attribute value.

Parameters
nameThe attribute name.
Returns
The float attribute value with the given name.

Reimplemented in te::gdal::DataSet.

std::auto_ptr<te::gm::Geometry> te::mem::DataSet::getGeometry ( std::size_t  i) const
virtual

Method for retrieving a geometric attribute value.

Parameters
iThe attribute index.
Returns
The geometric attribute value in the given position.

Implements te::da::DataSet.

virtual std::auto_ptr<te::gm::Geometry> te::da::DataSet::getGeometry ( const std::string &  name) const
virtualinherited

Method for retrieving a geometric attribute value.

Parameters
nameThe attribute name.
Returns
The geometric attribute value with the given name.

Reimplemented in te::gdal::DataSet.

boost::int16_t te::mem::DataSet::getInt16 ( std::size_t  i) const
virtual

Method for retrieving a 16-bit integer attribute value (2 bytes long).

Parameters
iThe attribute index.
Returns
The 16-bit integer attribute value (2 bytes long) in the given position.

Implements te::da::DataSet.

virtual boost::int16_t te::da::DataSet::getInt16 ( const std::string &  name) const
virtualinherited

Method for retrieving a 16-bit integer attribute value (2 bytes long).

Parameters
nameThe attribute name.
Returns
The 16-bit integer attribute value (2 bytes long) with the given name.

Reimplemented in te::gdal::DataSet.

boost::int32_t te::mem::DataSet::getInt32 ( std::size_t  i) const
virtual

Method for retrieving a 32-bit integer attribute value (4 bytes long).

Parameters
iThe attribute index.
Returns
The 32-bit integer attribute value in the given position.

Implements te::da::DataSet.

virtual boost::int32_t te::da::DataSet::getInt32 ( const std::string &  name) const
virtualinherited

Method for retrieving a 32-bit integer attribute value (4 bytes long).

Parameters
nameThe attribute name.
Returns
The 32-bit integer attribute value with the given name.

Reimplemented in te::gdal::DataSet.

boost::int64_t te::mem::DataSet::getInt64 ( std::size_t  i) const
virtual

Method for retrieving a 64-bit integer attribute value (8 bytes long).

Parameters
iThe attribute index.
Returns
The 64-bit integer attribute value in the given position.

Implements te::da::DataSet.

virtual boost::int64_t te::da::DataSet::getInt64 ( const std::string &  name) const
virtualinherited

Method for retrieving a 64-bit integer attribute value (8 bytes long).

Parameters
nameThe attribute name.
Returns
The 64-bit integer attribute value with the given name.

Reimplemented in te::gdal::DataSet.

DataSetItem* te::mem::DataSet::getItem ( ) const
std::string te::mem::DataSet::getNumeric ( std::size_t  i) const
virtual

Method for retrieving a numeric attribute value.

Parameters
iThe attribute index.
Returns
The numeric attribute value in the given position.

Implements te::da::DataSet.

virtual std::string te::da::DataSet::getNumeric ( const std::string &  name) const
virtualinherited

Method for retrieving a numeric attribute value.

Parameters
nameThe attribute name.
Returns
The numeric attribute value with the given name.

Reimplemented in te::gdal::DataSet.

std::size_t te::mem::DataSet::getNumProperties ( ) const
virtual

It returns the number of properties that composes an item of the dataset.

Returns
The number of properties that composes an item of the dataset.

Implements te::da::DataSet.

int te::mem::DataSet::getPropertyDataType ( std::size_t  i) const
virtual

It returns the underlying data type of the property at position pos.

Parameters
iThe property position of interest.
Returns
The underlying data type of the property at position pos.

Implements te::da::DataSet.

std::string te::mem::DataSet::getPropertyName ( std::size_t  i) const
virtual

It returns the property name at position pos.

Parameters
iThe property name at the position of interest.
Returns
The property name at position pos.

Implements te::da::DataSet.

std::auto_ptr<te::rst::Raster> te::mem::DataSet::getRaster ( std::size_t  i) const
virtual

Method for retrieving a raster attribute value.

Parameters
iThe attribute index.
Returns
The raster attribute value in the given position.
Exceptions
ExceptionIt can throw an exception if:
  • something goes wrong during the data retrieval
  • the maximum number of simultaneous accesses has been reached

Implements te::da::DataSet.

virtual std::auto_ptr<te::rst::Raster> te::da::DataSet::getRaster ( const std::string &  name) const
virtualinherited

Method for retrieving a raster attribute value.

Parameters
nameThe attribute name.
Returns
The raster attribute value with the given name.
Exceptions
ExceptionIt can throw an exception if:
  • something goes wrong during the data retrieval
  • the maximum number of simultaneous accesses has been reached

Reimplemented in te::gdal::DataSet.

std::string te::mem::DataSet::getString ( std::size_t  i) const
virtual

Method for retrieving a string value attribute.

Parameters
iThe attribute index.
Returns
The string attribute value in the given position.

Implements te::da::DataSet.

virtual std::string te::da::DataSet::getString ( const std::string &  name) const
virtualinherited

Method for retrieving a string attribute value.

Parameters
nameThe attribute name.
Returns
The string attribute value with the given name.

Reimplemented in te::gdal::DataSet.

te::common::TraverseType te::mem::DataSet::getTraverseType ( ) const
virtual

It returns the traverse type associated to the dataset.

Returns
The traverse type associated to the dataset.

Implements te::da::DataSet.

unsigned char te::mem::DataSet::getUChar ( std::size_t  i) const
virtual

Method for retrieving an unsigned character attribute value (1 byte long).

Parameters
iThe attribute index.
Returns
The unsigned character attribute value (1 byte long) in the given position.

Implements te::da::DataSet.

virtual unsigned char te::da::DataSet::getUChar ( const std::string &  name) const
virtualinherited

Method for retrieving an unsigned character attribute value (1 byte long).

Parameters
nameThe attribute name.
Returns
The unsigned character attribute value (1 byte long) with the given name.

Reimplemented in te::gdal::DataSet.

std::auto_ptr<te::dt::AbstractData> te::mem::DataSet::getValue ( std::size_t  i) const
virtual

Method for retrieving any other type of data value stored in the data source.

This method can be use for extensible datatypes.

Parameters
iThe attribute index.
Returns
A pointer to the data value.

Reimplemented from te::da::DataSet.

virtual std::auto_ptr<te::dt::AbstractData> te::da::DataSet::getValue ( const std::string &  name) const
virtualinherited

Method for retrieving any other type of data value stored in the data source.

This method can be use for extensible datatypes.

Parameters
nameThe attribute name.
Returns
A pointer to the data value.
bool te::mem::DataSet::isAfterEnd ( ) const
virtual

It tells if the dataset internal pointer is on the sentinel position after the last element of the collection or not.

Returns
True, if the dataset internal pointer is on the sentinel position after the last element otherwise it returns false.

Implements te::da::DataSet.

bool te::mem::DataSet::isAtBegin ( ) const
virtual

It tells if the dataset internal pointer is on the first element of the collection or not.

Returns
True if the dataset internal pointer is on the first element otherwise it returns false.

Implements te::da::DataSet.

bool te::mem::DataSet::isAtEnd ( ) const
virtual

It tells if the dataset internal pointer is on the last element of the collection.

Returns
True, if the dataset internal pointer is on the last element otherwise it returns false.

Implements te::da::DataSet.

bool te::mem::DataSet::isBeforeBegin ( ) const
virtual

It tells if the dataset internal pointer is in a position before the first element of the collection or not.

Returns
True, if the dataset internal pointer is in a position before the first element otherwise it returns false.

Implements te::da::DataSet.

bool te::mem::DataSet::isConnected ( ) const
virtual

It returns true if the dataset is connected and false if it is disconnected. A dataset can be connected or disconnected. A connected dataset, after its creation through the data source transactor, continues to depend on the connection given by its associated data source. Differently, a disconnected dataset, after its creation, no more depends of the connection given by the data source, and it continues to live after the connection has been released to the data source.

Returns
True, if the dataset is connected, or false if it is disconnected.

Implements te::da::DataSet.

bool te::mem::DataSet::isEmpty ( ) const
virtual

It returns true if the collection is empty.

Returns
True, if the collection is empty.

Implements te::da::DataSet.

bool te::mem::DataSet::isNull ( std::size_t  i) const
virtual

It checks if the attribute value is NULL.

Parameters
iThe attribute index.
Returns
True if the attribute value is NULL.

Implements te::da::DataSet.

virtual bool te::da::DataSet::isNull ( const std::string &  name) const
virtualinherited

It checks if the attribute value is NULL.

Parameters
nameThe attribute name.
Returns
True if the attribute value is NULL.

Reimplemented in te::gdal::DataSet.

bool te::mem::DataSet::move ( std::size_t  i)
virtual

It moves the dataset internal pointer to a given position.

Parameters
iThe position the dataset internal pointer must be set up.
Returns
True, if it was possible to move the dataset reading to the given position.
Note
The first item in the collection starts at address 0.

Implements te::da::DataSet.

bool te::mem::DataSet::moveBeforeFirst ( )
virtual

It moves the internal pointer to a position before the first item in the collection.

Returns
True, if it was possible to move to a sentinel position before the first item in the collection.
Note
This method is not supported by FORWARDONLY datasets.

Implements te::da::DataSet.

bool te::mem::DataSet::moveFirst ( )
virtual

It moves the internal pointer to the first item in the collection.

Returns
True, if it was possible to move to the first item in the collection.
Note
This method is not supported by FORWARDONLY datasets.

Implements te::da::DataSet.

bool te::mem::DataSet::moveLast ( )
virtual

It sets the dataset internal pointer to the last item in the collection.

Returns
True, if it was possible to move to the last item in the collection.

Implements te::da::DataSet.

bool te::mem::DataSet::moveNext ( )
virtual

It moves the internal pointer to the next item of the collection.

You always has to call this method in order to move the internal pointer to the first item in the collection. This method can be used to traverse a dataset.

Returns
True if the internal pointer is on a valid item, or false otherwise.
Note
All dataset types support this method: FORWARDONLY, BIDIRECTIONAL and RANDOM.

Implements te::da::DataSet.

bool te::mem::DataSet::movePrevious ( )
virtual

It moves the internal pointer to the previous item of the collection.

Returns
True, if the internal pointer (cursor position) is on a valid item, or false otherwise.
Note
This method is not supported by FORWARDONLY datasets.

Implements te::da::DataSet.

void te::mem::DataSet::remove ( )

It removes the current dataset item.

Note
In-Memory driver extended method.
void te::mem::DataSet::remove ( DataSetItem item)

It removes a specific dataset item.

Note
In-Memory driver extended method.
void te::mem::DataSet::setBool ( std::size_t  i,
bool  value 
)
void te::mem::DataSet::setBool ( const std::string &  name,
bool  value 
)
void te::mem::DataSet::setByteArray ( std::size_t  i,
te::dt::ByteArray value 
)
void te::mem::DataSet::setByteArray ( const std::string &  name,
te::dt::ByteArray value 
)
void te::mem::DataSet::setChar ( std::size_t  i,
char  value 
)
void te::mem::DataSet::setChar ( const std::string &  name,
char  value 
)
void te::mem::DataSet::setDateTime ( std::size_t  i,
te::dt::DateTime value 
)
void te::mem::DataSet::setDateTime ( const std::string &  name,
te::dt::DateTime value 
)
void te::mem::DataSet::setDouble ( std::size_t  i,
double  value 
)
void te::mem::DataSet::setDouble ( const std::string &  name,
double  value 
)
void te::mem::DataSet::setFloat ( std::size_t  i,
float  value 
)
void te::mem::DataSet::setFloat ( const std::string &  name,
float  value 
)
void te::mem::DataSet::setGeometry ( std::size_t  i,
te::gm::Geometry value 
)
void te::mem::DataSet::setGeometry ( const std::string &  name,
te::gm::Geometry value 
)
void te::mem::DataSet::setInt16 ( std::size_t  i,
boost::int16_t  value 
)
void te::mem::DataSet::setInt16 ( const std::string &  name,
boost::int16_t  value 
)
void te::mem::DataSet::setInt32 ( std::size_t  i,
boost::int32_t  value 
)
void te::mem::DataSet::setInt32 ( const std::string &  name,
boost::int32_t  value 
)
void te::mem::DataSet::setInt64 ( std::size_t  i,
boost::int64_t  value 
)
void te::mem::DataSet::setInt64 ( const std::string &  name,
boost::int64_t  value 
)
void te::mem::DataSet::setNumeric ( std::size_t  i,
const std::string &  value 
)
void te::mem::DataSet::setNumeric ( const std::string &  name,
const std::string &  value 
)
void te::mem::DataSet::setPropertyDataType ( int  dt,
std::size_t  pos 
)
void te::mem::DataSet::setPropertyName ( const std::string &  name,
std::size_t  pos 
)
void te::mem::DataSet::setRaster ( std::size_t  i,
te::rst::Raster value 
)
void te::mem::DataSet::setRaster ( const std::string &  name,
te::rst::Raster value 
)
void te::mem::DataSet::setString ( std::size_t  i,
const std::string &  value 
)
void te::mem::DataSet::setString ( const std::string &  name,
const std::string &  value 
)
void te::mem::DataSet::setUChar ( std::size_t  i,
unsigned char  value 
)
void te::mem::DataSet::setUChar ( const std::string &  name,
unsigned char  value 
)
void te::mem::DataSet::setValue ( std::size_t  i,
te::dt::AbstractData value 
)
void te::mem::DataSet::setValue ( const std::string &  name,
te::dt::AbstractData ad 
)
std::size_t te::mem::DataSet::size ( ) const
virtual

It returns the collection size, if it is known.

It may return std::string::npos if the size is not known, or it would be too costly to compute it.

Returns
The size of the collection, if it is known.

Implements te::da::DataSet.

void te::mem::DataSet::update ( te::dt::Property prop)

It update a property from the dataset.

Parameters
propThe property that will be updated.
Note
For now, for all items, the value will be changed to 0.
Note
In-Memory driver extended method.

Member Data Documentation

int te::mem::DataSet::m_i
protected

The index of the current item.

Definition at line 385 of file DataSet.h.

boost::shared_ptr<boost::ptr_vector<DataSetItem> > te::mem::DataSet::m_items
protected

The list of dataset items.

Definition at line 382 of file DataSet.h.

std::vector<std::string> te::mem::DataSet::m_pnames
protected

The list of property names.

Definition at line 383 of file DataSet.h.

std::vector<int> te::mem::DataSet::m_ptypes
protected

The list of property types.

Definition at line 384 of file DataSet.h.


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