2 * Copyright (C) 2000-2017 Paul Davis <paul@linuxaudiosystems.com>
3 * Copyright (C) 2006 Hans Fugal <hans@fugal.net>
4 * Copyright (C) 2009 David Robillard <d@drobilla.net>
5 * Copyright (C) 2012-2016 Tim Mayberry <mojofunk@gmail.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #include "pbd/string_convert.h"
33 Glib::Threads::Mutex* ID::counter_lock = 0;
34 uint64_t ID::_counter = 0;
40 counter_lock = new Glib::Threads::Mutex;
49 ID::ID (const ID& other)
56 /* danger, will robinson: could result in non-unique ID */
62 /* danger, will robinson: could result in non-unique ID */
69 Glib::Threads::Mutex::Lock lm (*counter_lock);
74 ID::string_assign (string str)
76 return string_to_uint64 (str, _id);
82 return to_string (_id);
86 ID::operator== (const string& str) const
88 return to_string (_id) == str;
92 ID::operator= (string str)
99 ID::operator= (const ID& other)
101 if (&other != this) {
108 operator<< (ostream& ostr, const ID& id)