AbstractCachePolicyFactory.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 AbstractCachePolicyFactory.h
22 
23  \brief This is the abstract factory for cache policy.
24 */
25 
26 #ifndef __TERRALIB_GRAPH_INTERNAL_ABSTRACTCACHEPOLICYFACTORY_H
27 #define __TERRALIB_GRAPH_INTERNAL_ABSTRACTCACHEPOLICYFACTORY_H
28 
29 // TerraLib
30 #include "../../common/AbstractFactory.h"
31 #include "../graphs/Graph.h"
32 #include "../Config.h"
33 
34 
35 namespace te
36 {
37  namespace graph
38  {
39  //forward declarations
40  class AbstractCachePolicy;
41 
42  /*!
43  \class AbstractCachePolicyFactory
44 
45  \brief This is the abstract factory for cache policy.
46 
47  \sa AbstractGraph
48  */
49  class TEGRAPHEXPORT AbstractCachePolicyFactory : public te::common::AbstractFactory<AbstractCachePolicy, std::string>
50  {
51  public:
52 
53  /*!
54  \brief It creates and returns default cache policy
55 
56  \return A default cache policy
57 
58  \note The caller will take the ownership of the returned pointer.
59  */
60  static AbstractCachePolicy* make();
61 
62  /*!
63  \brief It creates a cache policy with the proper type.
64 
65  \param cpType The name of the specific cache policy.
66 
67  \return A specific cache policy
68 
69  \note The caller will take the ownership of the returned pointer.
70  */
71  static AbstractCachePolicy* make(const std::string& cpType);
72 
73 
74  /*! \brief Destructor. */
76 
77  /*! \brief Returns the type (name) of this factory. */
78  virtual const std::string& getType() const = 0;
79 
80  protected:
81 
82  /*!
83  \brief Constructor.
84 
85  \param factoryKey The key that identifies the factory.
86  */
87  AbstractCachePolicyFactory(const std::string& factoryKey);
88  };
89 
90  } // end namespace graph
91 } // end namespace te
92 
93 #endif // __TERRALIB_GRAPH_INTERNAL_ABSTRACTCACHEPOLICYFACTORY_H
This class defines the interface of abstract factories without initializing parameters.
#define TEGRAPHEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:178
This is the abstract factory for cache policy.
This class is used to set the main functions of a cache policy.
URI C++ Library.