DataSetUseCounter.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/dataaccess/gdal/DataSetUseCounter.h
22 
23  \brief GDAL data set use counter.
24  */
25 
26 #ifndef __TERRALIB_DATAACCES_GDAL_INTERNAL_DATASETUSECOUNTER_H
27 #define __TERRALIB_DATAACCES_GDAL_INTERNAL_DATASETUSECOUNTER_H
28 
29 #include "Config.h"
30 #include "DataSetsManager.h"
31 #include "Exception.h"
32 
33 #include <boost/noncopyable.hpp>
34 
35 #include <string>
36 
37 namespace te
38 {
39  namespace gdal
40  {
41  /*!
42  \class DataSetUseCounter
43 
44  \brief GDAL data set use counter.
45  */
46  class TEGDALEXPORT DataSetUseCounter : protected boost::noncopyable
47  {
48  public :
49 
50  /*!
51  \brief Default constructor.
52  \param uri Raster URI.
53  \param aType Access type.
54  \exception Exception It can throw an exception (code te::common::NO_CONNECTION_AVAILABLE ) if:
55  <ul>
56  <li>the maximum number of simultaneous accesses has been reached</li>
57  </ul>
58  */
59  DataSetUseCounter( const std::string& uri, const DataSetsManager::AccessType aType ) throw( te::gdal::Exception );
60 
62 
63  /*!
64  \brief Change the acces type.
65  \param aType Access type.
66  \return true if OK, false on errors:
67  */
68  bool changeAccessType( const DataSetsManager::AccessType aType ) throw( te::gdal::Exception );
69 
70  /*!
71  \brief Returns the current access type.
72  \return Returns the current access type.
73  */
74  inline DataSetsManager::AccessType getAccessType() const { return m_aType; };
75 
76  private :
77 
78  DataSetsManager::AccessType m_aType; //!< Access type
79  std::string m_uri; //!< Data set uri.
80 
81  };
82  } // end namespace gdal
83 } // end namespace te
84 
85 #endif // __TERRALIB_DATAACCES_GDAL_INTERNAL_DATASETSMANAGER_H
std::string m_uri
Data set uri.
#define TEGDALEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:67
An exception class for the GDAL module.
URI C++ Library.
GDAL data set use counter.
Configuration flags for the GDAL Driver of TerraLib.