Class used to manager the graph data elements. This class uses a cache policy to control the elements in memory. If a element was requested and not found in cache, the GraphDataManager is used to loaded a new GraphData.
More...
#include <GraphCache.h>
Class used to manager the graph data elements. This class uses a cache policy to control the elements in memory. If a element was requested and not found in cache, the GraphDataManager is used to loaded a new GraphData.
- See also
- GraphDataManager, GraphData
Definition at line 60 of file GraphCache.h.
Default constructor.
- Parameters
-
cp | Implementation of a cache policy |
dm | Data manager pointer |
te::graph::GraphCache::~GraphCache |
( |
| ) |
|
GraphData* te::graph::GraphCache::checkCacheByEdgeId |
( |
int |
id | ) |
|
This functions check in cache if the edge element with a given id was alredy in memory.
- Parameters
-
- Returns
- If the element was found its returns a pointer to a graph data that contains this element
GraphData* te::graph::GraphCache::checkCacheByVertexId |
( |
int |
id | ) |
|
This functions check in cache if the vertex element with a given id was alredy in memory.
- Parameters
-
- Returns
- If the element was found its returns a pointer to a graph data that contains this element
void te::graph::GraphCache::clearCache |
( |
| ) |
|
Used to remove from memory all elements loaded.
- Note
- The function Flush from AbstractGraph calls this function.
GraphData* te::graph::GraphCache::createGraphData |
( |
| ) |
|
Creates a new graph data structure.
- Returns
- A pointer to a new graph data
GraphData* te::graph::GraphCache::getGraphData |
( |
| ) |
|
Get a graph data.
- Note
- It's always try to return the graph data with the max number of elements that is not already full. If its not possible a new graph data will be created.
- Returns
- A pointer to a graph data.
GraphData* te::graph::GraphCache::getGraphDataByEdgeId |
( |
int |
id | ) |
|
Get a graph data from vector using a edge id information. if not found a new graph data has to be loaded using AbstractDataManager.
- Parameters
-
id | The edge identifier of the desired element. |
- Returns
- A Graph Data that contains the request element.
GraphData* te::graph::GraphCache::getGraphDataByVertexId |
( |
int |
id | ) |
|
Get a graph data from vector using a vertex id information. if not found a new graph data has to be loaded using AbstractDataManager.
- Parameters
-
id | The vertex identifier of the desired element. |
- Returns
- A Graph Data that contains the request element.
int te::graph::GraphCache::getGraphDataId |
( |
| ) |
|
|
protected |
Protected function used to define a new value of Id to a graph data.
- Returns
- Integer value with the id information
void te::graph::GraphCache::removeGraphData |
( |
int |
idx | ) |
|
Used to remove a graph data from cache.
- Parameters
-
idx | The graph data identifier |
void te::graph::GraphCache::saveGraphData |
( |
GraphData * |
data | ) |
|
Save the graph data structure inside a data source.
- Parameters
-
data | The graph data to be saved |
int te::graph::GraphCache::m_graphDataCounter |
|
private |
std::map<int, GraphData*> te::graph::GraphCache::m_graphDataMap |
|
private |
Cache policy to control the cache in memory.
Definition at line 179 of file GraphCache.h.
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_master/terralib5/src/terralib/graph/core/GraphCache.h