AbstractFeeder.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/rp/AbstractFeeder.h
22  \brief Abstract objects feeder.
23  */
24 
25 #ifndef __TERRALIB_RP_INTERNAL_ABSTRACTFEEDER_H
26 #define __TERRALIB_RP_INTERNAL_ABSTRACTFEEDER_H
27 
28 #include "Config.h"
29 
30 #include <boost/noncopyable.hpp>
31 
32 namespace te
33 {
34  namespace rp
35  {
36  /*!
37  \class AbstractFeeder
38  \brief Abstract objects feeder.
39  \details Sequential objects feeder to image processing algorithms.
40  */
41  template< typename ObjType >
42  class AbstractFeeder : private boost::noncopyable
43  {
44  public :
45 
47 
48  virtual ~AbstractFeeder() {};
49 
50  /*!
51  \brief Return the current sequence object.
52  \return A pointer to the current object or a null pointer if there are no object to return.
53  */
54  virtual ObjType* getCurrentObj() const = 0;
55 
56  /*!
57  \brief Advances to the next sequence obeject.
58  \return true if the advance was completed or false if the objects sequence end was reached.
59  \note This method can invalidate any pointer returned by getCurrentObj.
60  */
61  virtual bool moveNext() = 0;
62 
63  /*!
64  \brief Jump to the given object index.
65  \return true if the jump was completed or false on errors.
66  \note This method can invalidate any pointer returned by getCurrentObj.
67  */
68  virtual bool moveTo( const unsigned int index ) = 0;
69 
70  /*!
71  \brief Reset the feeder to the first position (subsequent accesses will start from the first sequence obejct).
72  \note This method can invalidate any pointer returned by getCurrentObj.
73  */
74  virtual void reset() = 0;
75 
76  /*!
77  \brief Return the total number of feeder objects.
78  \return The total number of feeder objects.
79  */
80  virtual unsigned int getObjsCount() const = 0;
81 
82  /*!
83  \brief Return the index of the current object.
84  \return The index of the current object.
85  */
86  virtual unsigned int getCurrentOffset() const = 0;
87  };
88  } // end namespace rp
89 } // end namespace te
90 
91 #endif // __TERRALIB_RP_INTERNAL_ABSTRACTFEEDER_H
92 
Abstract objects feeder.
virtual unsigned int getObjsCount() const =0
Return the total number of feeder objects.
virtual ObjType * getCurrentObj() const =0
Return the current sequence object.
virtual void reset()=0
Reset the feeder to the first position (subsequent accesses will start from the first sequence obejct...
virtual bool moveNext()=0
Advances to the next sequence obeject.
URI C++ Library.
virtual bool moveTo(const unsigned int index)=0
Jump to the given object index.
Configuration flags for the Raster Processing module of TerraLib.
virtual unsigned int getCurrentOffset() const =0
Return the index of the current object.