[complement-svn] SF.net SVN: complement: [1407] trunk/complement/explore/include/mt/uid.h
Status: Pre-Alpha
Brought to you by:
complement
From: <com...@us...> - 2006-11-24 18:56:30
|
Revision: 1407 http://svn.sourceforge.net/complement/?rev=1407&view=rev Author: complement Date: 2006-11-24 10:47:01 -0800 (Fri, 24 Nov 2006) Log Message: ----------- add copy constructor, assignment, etc. Modified Paths: -------------- trunk/complement/explore/include/mt/uid.h Modified: trunk/complement/explore/include/mt/uid.h =================================================================== --- trunk/complement/explore/include/mt/uid.h 2006-11-24 16:03:22 UTC (rev 1406) +++ trunk/complement/explore/include/mt/uid.h 2006-11-24 18:47:01 UTC (rev 1407) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/11/23 23:34:55 ptr> +// -*- C++ -*- Time-stamp: <06/11/24 20:50:19 ptr> /* * Copyright (c) 2006 @@ -23,23 +23,25 @@ struct uuid_type { - union { - uint8_t b[16]; - uint32_t i[4]; - uint64_t l[2]; - } u; + union { + uint8_t b[16]; + uint32_t i[4]; + uint64_t l[2]; + } u; - uuid_type() - {} + uuid_type() + { u.l[0] = 0; u.l[1] = 0; } - uuid_type( const uuid_type& uid ) - { - // u.i[0] = uid.u.i[0]; u.i[1] = uid.u.i[1]; - // u.i[2] = uid.u.i[2]; u.i[3] = uid.u.i[3]; - u.l[0] = uid.u.l[0]; u.l[1] = uid.u.l[1]; - } + uuid_type( const uuid_type& uid ) + { + // u.i[0] = uid.u.i[0]; u.i[1] = uid.u.i[1]; + // u.i[2] = uid.u.i[2]; u.i[3] = uid.u.i[3]; + u.l[0] = uid.u.l[0]; u.l[1] = uid.u.l[1]; + } + uuid_type& operator =( const uuid_type& uid ) + { u.l[0] = uid.u.l[0]; u.l[1] = uid.u.l[1]; return *this; } bool operator ==( const uuid_type& uid ) const { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |