33 #include "../../common/STLUtils.h" 
   34 #include "../../common/StringUtils.h" 
   35 #include "../../common/Translator.h" 
   36 #include "../core/Edge.h" 
   37 #include "../core/EdgeProperty.h" 
   38 #include "../core/GraphData.h" 
   39 #include "../core/GraphDataManager.h" 
   40 #include "../core/GraphCache.h" 
   41 #include "../core/GraphMetadata.h" 
   42 #include "../core/Vertex.h" 
   43 #include "../core/VertexProperty.h" 
   44 #include "../loader/AbstractGraphLoaderStrategy.h" 
   45 #include "../Config.h" 
   46 #include "../Exception.h" 
  102     m_graphData = m_graphCache->getGraphData();
 
  105   m_graphData->addVertex(v);
 
  107   if(m_graphData->getVertexMap().size() >= m_metadata->m_maxCacheSize && !m_metadata->m_memoryGraph)
 
  117   m_graphData->setDirty(
true);
 
  122   bool res = m_graphData->removeVertex(
id);
 
  124   if(!res && !m_metadata->m_memoryGraph)
 
  126     m_graphData = m_graphCache->getGraphDataByVertexId(
id);
 
  129       m_graphData->removeVertex(
id);
 
  134     m_dataManager->removeVertex(
id);
 
  144     v = m_graphData->getVertex(
id);
 
  147   if(!v && !m_metadata->m_memoryGraph)
 
  149     m_graphData = m_graphCache->getGraphDataByVertexId(
id);
 
  152       v = m_graphData->getVertex(
id);
 
  162     m_metadata->addVertexProperty(p);
 
  170     m_metadata->removeVertexProperty(idx);
 
  178     return m_metadata->getVertexProperty(idx);
 
  188     return m_metadata->getVertexPropertySize();
 
  198     m_graphData = m_graphCache->getGraphData();
 
  201   m_graphData->addEdge(e);
 
  203   if(m_graphData->getEdgeMap().size() >= m_metadata->m_maxCacheSize && !m_metadata->m_memoryGraph)
 
  213   m_graphData->setDirty(
true);
 
  218   bool res = m_graphData->removeEdge(
id);
 
  220   if(!res && !m_metadata->m_memoryGraph)
 
  222     m_graphData = m_graphCache->getGraphDataByEdgeId(
id);
 
  225       m_graphData->removeEdge(
id);
 
  230     m_dataManager->removeEdge(
id);
 
  240     e = m_graphData->getEdge(
id);
 
  243   if(!e && !m_metadata->m_memoryGraph)
 
  245     m_graphData = m_graphCache->getGraphDataByEdgeId(
id);
 
  248       e = m_graphData->getEdge(
id);
 
  258     m_metadata->addEdgeProperty(p);
 
  266     m_metadata->removeEdgeProperty(idx);
 
  274     return m_metadata->getEdgeProperty(idx);
 
  284     return m_metadata->getEdgePropertySize();
 
  297   if(m_metadata->m_memoryGraph)
 
  305     m_graphCache->clearCache();
 
GraphMetadata * m_metadata
Graph Data loader strategy. 
 
te::graph::GraphMetadata * getMetadata()
It returns a pointer to a class that describes the graph metadata. 
 
virtual void removeEdgeProperty(int idx)
Remove a property associated to the edge element. 
 
virtual void removeEdge(int id)
This function removes the edge element from graph, also was removed in data source. 
 
void setLoaderStrategy(AbstractGraphLoaderStrategy *loaderStrategy)
Function used to set a current loader strategy. 
 
virtual void addEdgeProperty(te::dt::Property *p)
Add a new property associated to the edge element. 
 
virtual te::graph::Edge * getEdge(int id)
It returns the edge element if it's exist. 
 
It models a property definition. 
 
From the point of view of graph theory, vertices are treated as featureless and indivisible objects...
 
Class used to define the edge struct of a graph. Its compose with a identifier, the vertex origin and...
 
This class is used to set the main functions of a cache policy. 
 
GraphCache * m_graphCache
Class used to keep all graph data loaded. 
 
GraphDataManager * m_dataManager
Used to load and save GraphData information from a DataSource. 
 
virtual te::dt::Property * getVertexProperty(int idx)
Get a vertex property given a index. 
 
Abstract class used to define the main functions of graph struct. All graph implementations must used...
 
virtual int getVertexPropertySize()
Used to verify the number of properties associated to vertex elements. 
 
virtual void flush()
Function used to clear the memory cache, all elements was released from memory, if any element was ch...
 
void setDirty(bool flag)
Flag used to indicate that this element was changed. 
 
This class define the main functions necessary to save and load the graph data and metadata informati...
 
virtual void add(Vertex *v)
Add a new vertex element to a graph. 
 
virtual void removeVertexProperty(int idx)
Remove a property associated to the vertex element. 
 
void setDirty(bool flag)
Flag used to indicate that this element was changed. 
 
This is the main graph implementation, that uses a cache policy anda graph loader to get all elements...
 
Class used to manager the graph data elements. This class uses a cache policy to control the elements...
 
This class define a important struct used to group a map of vertex and edges. A flag is used to indic...
 
GraphData * m_graphData
This class has the graph data and properties. 
 
~Graph()
Virtual destructor. 
 
virtual void addVertexProperty(te::dt::Property *p)
Add a new property associated to the vertex element. 
 
virtual int getEdgePropertySize()
Used to verify the number of properties associated to edge elements. 
 
virtual te::dt::Property * getEdgeProperty(int idx)
Get a edge property given a index. 
 
virtual te::graph::Vertex * getVertex(int id)
It returns the vertex element if it's exist. 
 
virtual te::graph::GraphMetadata * getMetadata()
Function used to access the graph metadata. 
 
virtual void update(Vertex *v)
Update the vertex element. 
 
virtual void removeVertex(int id)
This function removes the vertex element from graph, also was removed in data source.