diff --git a/common/include/villas/graph/directed.hpp b/common/include/villas/graph/directed.hpp index 0f084a950..8ae840cd3 100644 --- a/common/include/villas/graph/directed.hpp +++ b/common/include/villas/graph/directed.hpp @@ -86,7 +86,7 @@ public: { vertex->id = lastVertexId++; - logger->debug("New vertex: {}", *vertex); + logger->debug("New vertex: {}", vertex->toString()); vertices[vertex->id] = vertex; return vertex->id; @@ -103,7 +103,7 @@ public: edge->from = fromVertexId; edge->to = toVertexId; - logger->debug("New edge {}: {} -> {}", *edge, edge->from, edge->to); + logger->debug("New edge {}: {} -> {}", edge->toString(), edge->from, edge->to); // This is a directed graph, so only push edge to starting vertex getVertex(edge->from)->edges.push_back(edge->id); @@ -242,7 +242,7 @@ public: ssEdges << getEdge(edge)->to << " "; } - logger->info(" {} connected to: {}", *vertex, ssEdges.str()); + logger->info(" {} connected to: {}", vertex->toString(), ssEdges.str()); } std::fstream s(fileName, s.out | s.trunc); @@ -254,7 +254,7 @@ public: for (auto &e : edges) { auto &edge = e.second; - logger->info(" {}: {} -> {}", *edge, edge->from, edge->to); + logger->info(" {}: {} -> {}", edge->toString(), edge->from, edge->to); if (s.is_open()) { auto from = getVertex(edge->from); auto to = getVertex(edge->to); diff --git a/common/include/villas/graph/edge.hpp b/common/include/villas/graph/edge.hpp index 6cd655919..8c2800365 100644 --- a/common/include/villas/graph/edge.hpp +++ b/common/include/villas/graph/edge.hpp @@ -39,6 +39,12 @@ public: return from; } + std::string toString() { + std::stringstream ss; + ss << *this; + return ss.str(); + } + private: Identifier id; Vertex::Identifier from; diff --git a/common/include/villas/graph/vertex.hpp b/common/include/villas/graph/vertex.hpp index 365422ed6..4183833f6 100644 --- a/common/include/villas/graph/vertex.hpp +++ b/common/include/villas/graph/vertex.hpp @@ -38,6 +38,12 @@ public: return this->id == other.id; } + std::string toString() { + std::stringstream ss; + ss << *this; + return ss.str(); + } + private: Identifier id; // HACK: how to resolve this circular type dependency? diff --git a/common/include/villas/plugin.hpp b/common/include/villas/plugin.hpp index 71b94f9c9..2a7c59af4 100644 --- a/common/include/villas/plugin.hpp +++ b/common/include/villas/plugin.hpp @@ -167,6 +167,7 @@ public: { return os << p.getName(); } + }; template @@ -178,7 +179,7 @@ Registry::dump() for (Plugin *p : plugins) { T *t = dynamic_cast(p); if (t) - getLogger()->info(" - {}: {}", *p, p->getDescription()); + getLogger()->info(" - {}: {}", p->getName(), p->getDescription()); } } diff --git a/common/lib/memory_manager.cpp b/common/lib/memory_manager.cpp index ef0b8000f..c55538dd4 100644 --- a/common/lib/memory_manager.cpp +++ b/common/lib/memory_manager.cpp @@ -98,7 +98,7 @@ MemoryManager::findPath(const MemoryManager::AddressSpaceId &fromAddrSpaceId, if (not memoryGraph.getPath(fromAddrSpaceId, toAddrSpaceId, pathGraph, pathCheckFunc)) { logger->debug("No translation found from ({}) to ({})", - *fromAddrSpace, *toAddrSpace); + fromAddrSpace->toString(), toAddrSpace->toString()); throw std::out_of_range("no translation found"); } @@ -122,7 +122,7 @@ MemoryManager::getTranslation(const MemoryManager::AddressSpaceId &fromAddrSpace auto fromAddrSpace = memoryGraph.getVertex(fromAddrSpaceId); auto toAddrSpace = memoryGraph.getVertex(toAddrSpaceId); logger->debug("No translation found from ({}) to ({})", - *fromAddrSpace, *toAddrSpace); + fromAddrSpace->toString(), toAddrSpace->toString()); throw std::out_of_range("no translation found"); }