From 601f44ebd02635db22d750621b0615dc5b9233b8 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 18 Feb 2013 21:17:01 -0600 Subject: gras: another var for id string - ez to change later --- lib/element.cpp | 3 ++- lib/element_impl.hpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/element.cpp b/lib/element.cpp index 27a5db0..faefee9 100644 --- a/lib/element.cpp +++ b/lib/element.cpp @@ -19,6 +19,7 @@ Element::Element(const std::string &name) this->reset(new ElementImpl()); (*this)->name = name; (*this)->unique_id = ++unique_id_pool; + (*this)->id = str(boost::format("%s(%d)") % this->name() % this->unique_id()); if (GENESIS) std::cerr << "New element: " << to_string() << std::endl; @@ -57,7 +58,7 @@ std::string Element::name(void) const std::string Element::to_string(void) const { - return str(boost::format("%s(%d)") % this->name() % this->unique_id()); + return (*this)->id; } void Element::set_output_signature(const IOSignature &sig) diff --git a/lib/element_impl.hpp b/lib/element_impl.hpp index 5c2d998..4fb025e 100644 --- a/lib/element_impl.hpp +++ b/lib/element_impl.hpp @@ -26,6 +26,7 @@ struct ElementImpl //common element properties std::string name; long unique_id; + std::string id; IOSignature input_signature; IOSignature output_signature; -- cgit