ID::ID ()
{
Glib::Mutex::Lock lm (*counter_lock);
- id = _counter++;
+ _id = _counter++;
}
ID::ID (string str)
int
ID::string_assign (string str)
{
- return sscanf (str.c_str(), "%" PRIu64, &id) != 0;
+ return sscanf (str.c_str(), "%" PRIu64, &_id) != 0;
}
void
ID::print (char* buf) const
{
/* XXX sizeof buf is unknown. bad API design */
- snprintf (buf, 16, "%" PRIu64, id);
+ snprintf (buf, 16, "%" PRIu64, _id);
}
string ID::to_s() const
}
ostream&
-operator<< (ostream& ostr, const ID& id)
+operator<< (ostream& ostr, const ID& _id)
{
char buf[32];
- id.print (buf);
+ _id.print (buf);
ostr << buf;
return ostr;
}
ID (std::string);
bool operator== (const ID& other) const {
- return id == other.id;
+ return _id == other._id;
}
bool operator!= (const ID& other) const {
- return id != other.id;
+ return _id != other._id;
}
ID& operator= (std::string);
bool operator< (const ID& other) const {
- return id < other.id;
+ return _id < other._id;
}
void print (char* buf) const;
static void init ();
private:
- uint64_t id;
+ uint64_t _id;
int string_assign (std::string);
static Glib::Mutex* counter_lock;