All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SegmenterSegmentsPool.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 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/SegmenterSegmentsPool.h
22  \brief Segments pool.
23  */
24 
25 #ifndef __TERRALIB_RP_INTERNAL_SEGMENTERSEGMENTSPOOL_H
26 #define __TERRALIB_RP_INTERNAL_SEGMENTERSEGMENTSPOOL_H
27 
28  #include "Config.h"
29  #include "SegmenterSegment.h"
30 
31  #include <boost/noncopyable.hpp>
32 
33  #include <vector>
34 
35  namespace te
36  {
37  namespace rp
38  {
39  /*!
40  \class SegmenterSegmentsPool
41  \brief Segments pool.
42  */
43  class TERPEXPORT SegmenterSegmentsPool : private boost::noncopyable
44  {
45  public :
46 
48 
50 
51  /*!
52  \brief Store a new segment.
53  \param segPtr A pointer to the segment to be stored.
54  \note The pool will acquire the segment's ownership.
55  */
56  void store( SegmenterSegment* segPtr );
57 
58  /*!
59  \brief Retrive a stored segment.
60  \return A pointer to a segment or null if the pool is empty.
61  \note The caller of this method must acquire the segment's ownership.
62  */
63  SegmenterSegment* retrive();
64 
65  /*!
66  \brief Clear all stored segments.
67  */
68  void clear();
69 
70  /*!
71  \brief Returns true if the pool is empty.
72  \return Returns true if the pool is empty.
73  */
74  inline bool empty() const { return m_segments.empty(); };
75 
76  protected :
77 
78  std::vector< SegmenterSegment* > m_segments; //!< Internal stored segments.
79 
80  };
81  } // namespace rp
82  } // namespace te
83 
84 #endif
Segmenter segment base class.
Segmenter segment base class.
Configuration flags for the Raster Processing module of TerraLib.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:91