summaryrefslogtreecommitdiff
path: root/lib/element.cpp
diff options
context:
space:
mode:
authorJosh Blum2013-06-01 23:12:21 -0700
committerJosh Blum2013-06-01 23:12:21 -0700
commitab1f7e5871d9323242e9b3d21e2f7811f1567c43 (patch)
tree3046176a463a3938a86563bdbf274467ff30974e /lib/element.cpp
parentd15ca88acfbd71c5d4f8ab3dabe0f4fbde205985 (diff)
downloadsandhi-ab1f7e5871d9323242e9b3d21e2f7811f1567c43.tar.gz
sandhi-ab1f7e5871d9323242e9b3d21e2f7811f1567c43.tar.bz2
sandhi-ab1f7e5871d9323242e9b3d21e2f7811f1567c43.zip
gras: mutex fixes for uid API calls
Diffstat (limited to 'lib/element.cpp')
-rw-r--r--lib/element.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/element.cpp b/lib/element.cpp
index 04a638b..c06d96d 100644
--- a/lib/element.cpp
+++ b/lib/element.cpp
@@ -33,7 +33,7 @@ Element::Element(const std::string &name)
catch(const std::invalid_argument &ex)
{
extra = str(boost::format("%04x") % short(h++));
- uid = name+"#"+extra;
+ uid = name+" "+extra;
}
}
if (not extra.empty()) (*this)->repr = name;
@@ -74,6 +74,11 @@ bool Element::equals(const Element &rhs)
return this->get() == rhs.get();
}
+std::string Element::to_string(void) const
+{
+ return (*this)->repr;
+}
+
void Element::adopt_element(const std::string &name, const Element &child)
{
if (child->parent) throw std::invalid_argument(str(boost::format(