AbstractCachePolicy.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 AbstractCachePolicy.h
22 
23  \brief This class is used to set the main functions of a cache policy.
24 
25  This is a generic interface to control the access frequency to
26  any type of objects. Only the index of each object is controlled
27  by this class.
28 */
29 
30 #ifndef __TERRALIB_GRAPH_INTERNAL_ABSTRACTCACHEPOLICY_H
31 #define __TERRALIB_GRAPH_INTERNAL_ABSTRACTCACHEPOLICY_H
32 
33 // Terralib Includes
34 #include "../Config.h"
35 
36 // STL Includes
37 
38 
39 namespace te
40 {
41  namespace graph
42  {
43  /*!
44  \class AbstractCachePolicy
45 
46  \brief This class is used to set the main functions of a cache policy.
47 
48  This is a generic interface to control the access frequency to
49  any type of objects. Only the index of each object is controlled
50  by this class.
51 
52  */
53 
55  {
56  public:
57 
58  /*! \brief Default constructor. */
60 
61  /*! \brief Virtual destructor. */
62  virtual ~AbstractCachePolicy();
63 
64 
65  /** @name Access Methods
66  * Method used to access the cache policy
67  */
68  //@{
69 
70  /*!
71  \brief Function used to add a new index to be controlled.
72 
73  \param value Object index attribute
74 
75  */
76  virtual void added(int value) = 0;
77 
78  /*!
79  \brief Function used to inform that an index must be updated
80 
81  \param value Object index attribute
82 
83  */
84  virtual void update(int value) = 0;
85 
86  /*!
87  \brief Function used to check what index has to be removed from the cache
88 
89  \param value Object index attribute
90 
91  */
92  virtual void toRemove(int& value) = 0;
93 
94  /*!
95  \brief Function used to inform that an index was accessed.
96 
97  \param value Object index attribute
98 
99  */
100  virtual void accessed(int value) = 0;
101 
102  //@}
103  };
104 
105  } // end namespace graph
106 } // end namespace te
107 
108 #endif // __TERRALIB_GRAPH_INTERNAL_ABSTRACTCACHEPOLICY_H
#define TEGRAPHEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:178
This class is used to set the main functions of a cache policy.
URI C++ Library.