add copy constructor for PBD::ID
git-svn-id: svn://localhost/ardour2/branches/3.0@6650 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -48,6 +48,11 @@ ID::ID ()
|
||||
_id = _counter++;
|
||||
}
|
||||
|
||||
ID::ID (const ID& other)
|
||||
{
|
||||
_id = other._id;
|
||||
}
|
||||
|
||||
ID::ID (string str)
|
||||
{
|
||||
string_assign (str);
|
||||
@@ -85,6 +90,15 @@ 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)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,8 @@ class ID {
|
||||
public:
|
||||
ID ();
|
||||
ID (std::string);
|
||||
|
||||
ID (const ID&);
|
||||
|
||||
bool operator== (const ID& other) const {
|
||||
return _id == other._id;
|
||||
}
|
||||
@@ -43,6 +44,7 @@ class ID {
|
||||
bool operator== (const std::string&) const;
|
||||
|
||||
ID& operator= (std::string);
|
||||
ID& operator= (const ID&);
|
||||
|
||||
bool operator< (const ID& other) const {
|
||||
return _id < other._id;
|
||||
|
||||
Reference in New Issue
Block a user