[complement-svn] SF.net SVN: complement: [1943] trunk/complement/explore
Status: Pre-Alpha
Brought to you by:
complement
From: <com...@us...> - 2008-07-07 06:39:36
|
Revision: 1943 http://complement.svn.sourceforge.net/complement/?rev=1943&view=rev Author: complement Date: 2008-07-06 23:39:32 -0700 (Sun, 06 Jul 2008) Log Message: ----------- convert uid to string; output uid to ostream; libxmt 2.0.6 Modified Paths: -------------- trunk/complement/explore/include/mt/uid.h trunk/complement/explore/lib/mt/ChangeLog trunk/complement/explore/lib/mt/Makefile.inc trunk/complement/explore/lib/mt/uid.cc Modified: trunk/complement/explore/include/mt/uid.h =================================================================== --- trunk/complement/explore/include/mt/uid.h 2008-07-02 11:01:18 UTC (rev 1942) +++ trunk/complement/explore/include/mt/uid.h 2008-07-07 06:39:32 UTC (rev 1943) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <08/06/06 21:21:30 yeti> +// -*- C++ -*- Time-stamp: <08/07/07 01:13:55 ptr> /* * Copyright (c) 2006, 2008 @@ -19,6 +19,7 @@ // #include <algorithm> #include <stdint.h> #include <stdexcept> +#include <ostream> namespace xmt { @@ -61,6 +62,8 @@ // return std::lexicographical_compare( u.i, u.i + 4, uid.u.i, uid.u.i + 4 ); return u.l[0] < uid.u.l[0] ? true : u.l[0] > uid.u.l[0] ? false : (u.l[1] < uid.u.l[1]); } + + operator std::string() const; }; const char *hostid_str() throw (std::runtime_error); @@ -71,4 +74,10 @@ } // namespace xmt +namespace std { + +std::ostream& operator <<( std::ostream&, const xmt::uuid_type& ); + +} // namespace std + #endif // __mt_uid_h Modified: trunk/complement/explore/lib/mt/ChangeLog =================================================================== --- trunk/complement/explore/lib/mt/ChangeLog 2008-07-02 11:01:18 UTC (rev 1942) +++ trunk/complement/explore/lib/mt/ChangeLog 2008-07-07 06:39:32 UTC (rev 1943) @@ -1,3 +1,10 @@ +2008-07-07 Petr Ovtchenkov <pt...@is...> + + * uid.cc, uid.h: convert uid to string; output uid + to ostream; + + * libxmt: bump revision to 2.0.6. + 2008-07-02 Petr Ovtchenkov <pt...@is...> * uid.cc: fix wrong type cast; Modified: trunk/complement/explore/lib/mt/Makefile.inc =================================================================== --- trunk/complement/explore/lib/mt/Makefile.inc 2008-07-02 11:01:18 UTC (rev 1942) +++ trunk/complement/explore/lib/mt/Makefile.inc 2008-07-07 06:39:32 UTC (rev 1943) @@ -1,9 +1,9 @@ -# -*- Makefile -*- Time-stamp: <08/07/02 09:28:02 ptr> +# -*- Makefile -*- Time-stamp: <08/07/07 10:35:20 ptr> LIBNAME = xmt MAJOR = 2 MINOR = 0 -PATCH = 5 +PATCH = 6 SRC_CC = xmt.cc thr_mgr.cc time.cc uid.cc shm.cc callstack.cc system_error.cc thread.cc \ date_time.cc SRC_C = fl.c Modified: trunk/complement/explore/lib/mt/uid.cc =================================================================== --- trunk/complement/explore/lib/mt/uid.cc 2008-07-02 11:01:18 UTC (rev 1942) +++ trunk/complement/explore/lib/mt/uid.cc 2008-07-07 06:39:32 UTC (rev 1943) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <08/07/02 13:15:01 yeti> +// -*- C++ -*- Time-stamp: <08/07/07 04:14:12 ptr> /* * Copyright (c) 2006, 2008 @@ -19,6 +19,26 @@ #include <iostream> +namespace std { + +std::ostream& operator <<( std::ostream& s, const xmt::uuid_type& uid ) +{ + std::ios_base::fmtflags f = s.flags( 0 ); + s << hex << setfill('0') + << setw(2) << uid.u.b[0] << setw(2) << uid.u.b[1] << setw(2) << uid.u.b[2] << setw(2) << uid.u.b[3] << '-' + << setw(2) << uid.u.b[4] << setw(2) << uid.u.b[5] << '-' + << setw(2) << uid.u.b[6] << setw(2) << uid.u.b[7] << '-' + << setw(2) << uid.u.b[8] << setw(2) << uid.u.b[9] << '-' + << setw(2) << uid.u.b[10] << setw(2) << uid.u.b[11] + << setw(2) << uid.u.b[12] << setw(2) << uid.u.b[13] + << setw(2) << uid.u.b[14] << setw(2) << uid.u.b[15]; + s.flags( f ); + + return s; +} + +} // namespace std + namespace xmt { namespace detail { @@ -83,6 +103,15 @@ using namespace std; using namespace std::tr2; +uuid_type::operator string() const +{ + ostringstream s; + + s << *this; + + return s.str(); +} + const char *hostid_str() throw (runtime_error) { static detail::__uid_init _uid; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |