All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::rp::FeederConstRasterDirectory Class Reference

A feeder from an input directory name. More...

#include <FeedersRaster.h>

Inheritance diagram for te::rp::FeederConstRasterDirectory:
te::rp::FeederConstRaster te::rp::AbstractFeeder< const te::rst::Raster >

Public Member Functions

 FeederConstRasterDirectory (const std::string &directoryName, const bool recursive, const std::string &rType, const bool sortFileNames, const std::vector< std::string > &fileExtensions)
 Constructor from an input directory name. More...
 
te::rst::Raster const * getCurrentObj () const
 Return the current sequence object. More...
 
unsigned int getCurrentOffset () const
 Return the index of the current object. More...
 
unsigned int getObjsCount () const
 Return the total number of feeder objects. More...
 
bool moveNext ()
 Advances to the next sequence obeject. More...
 
bool moveTo (const unsigned int index)
 Jump to the given object index. More...
 
void reset ()
 Reset the feeder to the first position (subsequent accesses will start from the first sequence obejct). More...
 
 ~FeederConstRasterDirectory ()
 

Protected Member Functions

 FeederConstRasterDirectory ()
 

Protected Attributes

std::vector< std::string >
::size_type 
m_currentOffset
 
std::auto_ptr< te::rst::Rasterm_currentRasterPtr
 
std::vector< std::string > m_filesNames
 
std::string m_rType
 

Detailed Description

A feeder from an input directory name.

Definition at line 140 of file FeedersRaster.h.

Constructor & Destructor Documentation

te::rp::FeederConstRasterDirectory::FeederConstRasterDirectory ( const std::string &  directoryName,
const bool  recursive,
const std::string &  rType,
const bool  sortFileNames,
const std::vector< std::string > &  fileExtensions 
)

Constructor from an input directory name.

Parameters
directoryNameThe directory full path name.
recursivetrue if a recursive search must be performed.
rTypeThe name of the specific driver to instantiate each raster.
sortFileNamesIf true, the file names will be sorted.
fileExtensionsThe file extensions filter (example: ".tif"), or an empty vector if all extensions must be accepted.

Definition at line 219 of file FeedersRaster.cpp.

References m_currentOffset, m_filesNames, and reset().

te::rp::FeederConstRasterDirectory::~FeederConstRasterDirectory ( )

Definition at line 309 of file FeedersRaster.cpp.

te::rp::FeederConstRasterDirectory::FeederConstRasterDirectory ( )
protected

Definition at line 304 of file FeedersRaster.cpp.

Member Function Documentation

te::rst::Raster const * te::rp::FeederConstRasterDirectory::getCurrentObj ( ) const
virtual

Return the current sequence object.

Returns
A pointer to the current object or a null pointer if there are no object to return.

Implements te::rp::FeederConstRaster.

Definition at line 313 of file FeedersRaster.cpp.

References m_currentRasterPtr.

unsigned int te::rp::FeederConstRasterDirectory::getCurrentOffset ( ) const
virtual

Return the index of the current object.

Returns
The index of the current object.

Implements te::rp::FeederConstRaster.

Definition at line 410 of file FeedersRaster.cpp.

References m_currentOffset.

unsigned int te::rp::FeederConstRasterDirectory::getObjsCount ( ) const
virtual

Return the total number of feeder objects.

Returns
The total number of feeder objects.

Implements te::rp::FeederConstRaster.

Definition at line 405 of file FeedersRaster.cpp.

References m_filesNames.

bool te::rp::FeederConstRasterDirectory::moveNext ( )
virtual

Advances to the next sequence obeject.

Returns
true if the advance was completed or false if the objects sequence end was reached.
Note
This method can invalidate any pointer returned by getCurrentObj.

Implements te::rp::FeederConstRaster.

Definition at line 318 of file FeedersRaster.cpp.

References m_currentOffset, m_currentRasterPtr, m_filesNames, m_rType, te::rst::RasterFactory::open(), and te::common::RAccess.

bool te::rp::FeederConstRasterDirectory::moveTo ( const unsigned int  index)
virtual

Jump to the given object index.

Returns
true if the jump was completed or false on errors.
Note
This method can invalidate any pointer returned by getCurrentObj.

Implements te::rp::FeederConstRaster.

Definition at line 354 of file FeedersRaster.cpp.

References m_currentOffset, m_currentRasterPtr, m_filesNames, m_rType, te::rst::RasterFactory::open(), and te::common::RAccess.

void te::rp::FeederConstRasterDirectory::reset ( )
virtual

Reset the feeder to the first position (subsequent accesses will start from the first sequence obejct).

Note
This method can invalidate any pointer returned by getCurrentObj.

Implements te::rp::FeederConstRaster.

Definition at line 382 of file FeedersRaster.cpp.

References m_currentOffset, m_currentRasterPtr, m_filesNames, m_rType, te::rst::RasterFactory::open(), and te::common::RAccess.

Referenced by FeederConstRasterDirectory().

Member Data Documentation

std::vector< std::string >::size_type te::rp::FeederConstRasterDirectory::m_currentOffset
protected
std::auto_ptr< te::rst::Raster > te::rp::FeederConstRasterDirectory::m_currentRasterPtr
protected

Definition at line 173 of file FeedersRaster.h.

Referenced by getCurrentObj(), moveNext(), moveTo(), and reset().

std::vector< std::string > te::rp::FeederConstRasterDirectory::m_filesNames
protected

Definition at line 172 of file FeedersRaster.h.

Referenced by FeederConstRasterDirectory(), getObjsCount(), moveNext(), moveTo(), and reset().

std::string te::rp::FeederConstRasterDirectory::m_rType
protected

Definition at line 170 of file FeedersRaster.h.

Referenced by moveNext(), moveTo(), and reset().


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