#endif
#include <inttypes.h>
-#include <pbd/id.h>
+#include "pbd/id.h"
#include <string>
using namespace std;
void
ID::init ()
{
- counter_lock = new Glib::Mutex;
+ if (!counter_lock)
+ counter_lock = new Glib::Mutex;
}
ID::ID ()
_id = _counter++;
}
+ID::ID (const ID& other)
+{
+ _id = other._id;
+}
+
ID::ID (string str)
{
string_assign (str);
return string(buf);
}
+bool
+ID::operator== (const string& str) const
+{
+ return to_s() == str;
+}
+
ID&
ID::operator= (string str)
{
return *this;
}
+ID&
+ID::operator= (const ID& other)
+{
+ if (&other != this) {
+ _id = other._id;
+ }
+ return *this;
+}
+
ostream&
operator<< (ostream& ostr, const ID& _id)
{