diff options
author | Josh Blum | 2013-02-18 21:17:01 -0600 |
---|---|---|
committer | Josh Blum | 2013-02-18 21:17:01 -0600 |
commit | 601f44ebd02635db22d750621b0615dc5b9233b8 (patch) | |
tree | d9c7da2c838c52a2cea57ef276ed36828d504dc4 | |
parent | f8cca035aacf1578b99f6ffa1bb99ffb052ac27c (diff) | |
download | sandhi-601f44ebd02635db22d750621b0615dc5b9233b8.tar.gz sandhi-601f44ebd02635db22d750621b0615dc5b9233b8.tar.bz2 sandhi-601f44ebd02635db22d750621b0615dc5b9233b8.zip |
gras: another var for id string - ez to change later
-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; |