SegmenterIdsManager.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/SegmenterIdsManager.h
22  \brief Segments IDs manager.
23  */
24 
25 #ifndef __TERRALIB_RP_INTERNAL_SEGMENTERIDSMANAGER_H
26 #define __TERRALIB_RP_INTERNAL_SEGMENTERIDSMANAGER_H
27 
28  #include "SegmenterSegmentsBlock.h"
29  #include "Config.h"
30 
31  #include <boost/thread.hpp>
32 
33  #include <list>
34  #include <vector>
35 
36  namespace te
37  {
38  namespace rp
39  {
40  /*!
41  \class SegmenterIdsManager
42  \brief Segmenter segments IDs manager.
43  */
45  {
46  public :
47 
49 
51 
52  /*!
53  \brief Returns a new segment unique ID.
54  \return id A positive new segment ID or zero if an error occurred.
55  \note This method is thread safe.
56  */
58 
59  /*!
60  \brief Returns new segment unique IDs.
61  \param idsNumber The number of unique IDs to return.
62  \param id The segment IDs.
63  \return true if OK, false on errors.
64  \note This method is thread safe.
65  */
66  bool getNewIDs(
67  const unsigned int& idsNumber,
68  std::vector< SegmenterSegmentsBlock::SegmentIdDataType >& ids );
69 
70  protected :
71 
72  /*! Internal free segments IDs counter - default 0) */
74 
75  /*! Internal free segments IDs counter mutex */
76  boost::mutex m_mutex;
77  };
78  } // namespace rp
79  } // namespace te
80 
81 #endif
Segmenter segments IDs manager.
bool getNewIDs(const unsigned int &idsNumber, std::vector< SegmenterSegmentsBlock::SegmentIdDataType > &ids)
Returns new segment unique IDs.
SegmenterSegmentsBlock::SegmentIdDataType getNewID()
Returns a new segment unique ID.
volatile SegmenterSegmentsBlock::SegmentIdDataType m_segmentsIdsCounter
TerraLib.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
Proxy configuration file for TerraView (see terraview_config.h).