data: database storage

* replaced storage by a new version that utilizes sqlite for persistence.
* added SqliteStorage to manage direct access to the database.
* added testsuit for sqlite.
* slimmed down the protected interface of the storage.
* changed tests in StorageTestSuit to avoid using protected methods of the storage.
* added functions to begin and commit a transaction to the storage.
* removed GraphFilterTestSuite.
* removed GraphFilterConductorTestSuite.
* added Node and Edge constructor that takes id as parameter
* added constructor for TokenComponentNameCached that accepts NameHierarchy as parameter
* added TokenLocation constructor that takes locationId as parameter.
* created respective construction functions in TokenLocatonLine, -File and -Collection.

fortune cookie message = Recognition will come from unexpected sources.
This commit is contained in:
malte_langkabel
2015-08-25 18:07:02 +02:00
parent d996cf384d
commit e628241b02
63 changed files with 167982 additions and 3582 deletions
+58 -2
View File
@@ -12,7 +12,7 @@ Graph::~Graph()
m_nodes.clear();
}
void Graph::copy(const FilterableGraph* other)
void Graph::copy(const Graph* other)
{
clear();
add(other);
@@ -24,7 +24,7 @@ void Graph::clear()
m_nodes.clear();
}
void Graph::add(const FilterableGraph* other)
void Graph::add(const Graph* other)
{
other->forEachNode(std::bind(&Graph::addNode, this, std::placeholders::_1));
other->forEachEdge(std::bind(&Graph::addEdge, this, std::placeholders::_1));
@@ -282,6 +282,62 @@ Edge* Graph::addEdgeAndAllChildrenAsPlainCopy(Edge* edge)
return addEdgeAsPlainCopy(edge);
}
size_t Graph::size() const
{
return getNodeCount() + getEdgeCount();
}
Token* Graph::getTokenById(Id id) const
{
Token* token = getNodeById(id);
if (!token)
{
token = getEdgeById(id);
}
return token;
}
void Graph::print(std::ostream& ostream) const
{
ostream << "Graph:\n";
ostream << "nodes (" << getNodeCount() << ")\n";
forEachNode(
[&ostream](Node* n)
{
ostream << *n << '\n';
}
);
ostream << "edges (" << getEdgeCount() << ")\n";
forEachEdge(
[&ostream](Edge* e)
{
ostream << *e << '\n';
}
);
}
void Graph::printBasic(std::ostream& ostream) const
{
ostream << getNodeCount() << " nodes:";
forEachNode(
[&ostream](Node* n)
{
ostream << ' ' << n->getTypeString() << ':' << n->getFullName();
}
);
ostream << '\n';
ostream << getEdgeCount() << " edges:";
forEachEdge(
[&ostream](Edge* e)
{
ostream << ' ' << e->getName();
}
);
ostream << '\n';
}
void Graph::removeEdgeInternal(Edge* edge)
{
std::map<Id, std::shared_ptr<Edge> >::const_iterator it = m_edges.find(edge->getId());