diff options
-rw-r--r-- | lib/element.cpp | 3 | ||||
-rw-r--r-- | lib/element_impl.hpp | 1 |
2 files changed, 3 insertions, 1 deletions
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; |