id_t becomes a fully-fledged object, UUID's used for IDs, generic MIDI now owns bindi...
[ardour.git] / libs / pbd / pbd / id.h
1 #ifndef __pbd_id_h__
2 #define __pbd_id_h__
3
4 #include <uuid/uuid.h>
5 #include <string>
6
7 namespace PBD {
8
9 class ID {
10   public:
11         ID ();
12         ID (std::string);
13         
14         bool operator== (const ID& other) const;
15         bool operator!= (const ID& other) const {
16                 return !operator== (other);
17         }
18         ID& operator= (std::string); 
19
20         bool operator< (const ID& other) const {
21                 return memcmp (id, other.id, sizeof (id)) < 0;
22         }
23
24         void print (char* buf) const;
25         
26   private:
27         uuid_t id;
28         int string_assign (std::string);
29 };
30
31 }
32 std::ostream& operator<< (std::ostream& ostr, const PBD::ID&);
33
34 #endif /* __pbd_id_h__ */