30 #include "../../common/STLUtils.h" 31 #include "../cache/AbstractCachePolicy.h" 32 #include "../cache/AbstractCachePolicyFactory.h" 33 #include "../loader/AbstractGraphLoaderStrategy.h" 63 std::map<int, GraphData*>::iterator itMap =
m_graphDataMap.begin();
69 te::graph::GraphData::VertexMap::iterator it = d->
getVertexMap().find(
id);
95 std::map<int, GraphData*>::iterator itMap =
m_graphDataMap.begin();
101 te::graph::GraphData::EdgeMap::iterator it = d->
getEdgeMap().find(
id);
133 std::map<int, GraphData*>::iterator itMap =
m_graphDataMap.begin();
201 std::map<int, GraphData*>::iterator it =
m_graphDataMap.find(idx);
249 std::map<int, GraphData*>::iterator itMap =
m_graphDataMap.begin();
255 te::graph::GraphData::VertexMap::iterator it = d->
getVertexMap().find(
id);
273 std::map<int, GraphData*>::iterator itMap =
m_graphDataMap.begin();
279 te::graph::GraphData::EdgeMap::iterator it = d->
getEdgeMap().find(
id);
void saveGraphData(GraphData *data)
Save the graph data structure in Data Source.
void loadGraphDataByVertexId(int vertexId, te::graph::GraphCache *gc=0)
Load a set of vertex elements that includes the desired element.
void clearCache()
Used to remove from memory all elements loaded.
~GraphCache()
Default destructor.
AbstractCachePolicy * m_policy
Cache policy to control the cache in memory.
te::graph::GraphMetadata * getMetadata()
It returns a pointer to a class that describes the graph metadata.
virtual void update(int value)=0
Function used to inform that an index must be updated.
VertexMap & getVertexMap()
It returns the the vertex map.
GraphData * getGraphDataByEdgeId(int id)
Get a graph data from vector using a edge id information. if not found a new graph data has to be loa...
int getGraphDataId()
Protected function used to define a new value of Id to a graph data.
int getId()
Get data identifier.
#define TE_DEFAULT_CACHE_POLICY_TYPE
This definition is used to set the default cache policy.
void removeGraphData(int idx)
Used to remove a graph data from cache.
GraphData * checkCacheByVertexId(int id)
This functions check in cache if the vertex element with a given id was alredy in memory...
This class define a important struct used to group a map of vertex and edges. A flag is used to indic...
GraphMetadata * m_metadata
Graph metadata information.
AbstractGraphLoaderStrategy * getLoaderStrategy()
Function used to get the current loader strategy.
This class is used to set the main functions of a cache policy.
GraphData * getGraphData()
Get a graph data.
This class defines a interface to access the graph elements inside a data source. Its use a implement...
GraphData * createGraphData()
Creates a new graph data structure.
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
void saveGraphData(GraphData *data)
Save the graph data structure inside a data source.
EdgeMap & getEdgeMap()
It returns the the edge map.
virtual void accessed(int value)=0
Function used to inform that an index was accessed.
Class used to manager the graph data elements. This class uses a cache policy to control the elements...
void loadGraphDataByEdgeId(int edgeId, te::graph::GraphCache *gc=0)
Load a set of edges elements that includes the desired element.
GraphData * checkCacheByEdgeId(int id)
This functions check in cache if the edge element with a given id was alredy in memory.
This class define a important struct used to group a map of vertex and edges. A flag is used to indic...
bool isDirty()
Used to check the graph data state.
std::map< int, GraphData * > m_graphDataMap
This map represents all data loaded in cache.
GraphDataManager * m_dataManager
Used to load and save GraphData information from a DataSource.
virtual void toRemove(int &value)=0
Function used to check what index has to be removed from the cache.
GraphData * getGraphDataByVertexId(int id)
Get a graph data from vector using a vertex id information. if not found a new graph data has to be l...
GraphCache(AbstractCachePolicy *cp, GraphDataManager *dm)
Default constructor.
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
int m_graphDataCounter
Graph data identifier counter.
virtual void added(int value)=0
Function used to add a new index to be controlled.
static AbstractCachePolicy * make()
It creates and returns default cache policy.