summaryrefslogtreecommitdiff
path: root/ACE
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2006-08-22 11:42:12 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2006-08-22 11:42:12 +0000
commit97930cb61775a189af86c17173dda39417acf9d5 (patch)
tree2bf18bcd50673f86485aa2e391ce6dd5e45f7a5d /ACE
parente0ea806de96a9e6859d5a576f105cb750c21fd3d (diff)
downloadATCD-97930cb61775a189af86c17173dda39417acf9d5.tar.gz
Tue Aug 22 11:41:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'ACE')
-rw-r--r--ACE/ChangeLog8
-rw-r--r--ACE/ace/UUID.cpp12
-rw-r--r--ACE/ace/UUID.h5
-rw-r--r--ACE/tests/UUIDTest.cpp12
4 files changed, 34 insertions, 3 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 26ca89aefde..7d67ebb32b3 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,11 @@
+Tue Aug 22 11:41:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/UUID.{h,cpp}:
+ Implemented copy constructor
+
+ * tests/UUIDTest.cpp:
+ Test copy constructor
+
Tue Aug 22 09:36:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/UUID.{h,inl}:
diff --git a/ACE/ace/UUID.cpp b/ACE/ace/UUID.cpp
index bbd01437437..9ea7f9961a3 100644
--- a/ACE/ace/UUID.cpp
+++ b/ACE/ace/UUID.cpp
@@ -83,6 +83,18 @@ namespace ACE_Utils
this->from_string_i (uuid_string);
}
+ UUID::UUID(const UUID &right)
+ : timeLow_ (right.timeLow_),
+ timeMid_ (right.timeMid_),
+ timeHiAndVersion_ (right.timeHiAndVersion_),
+ clockSeqHiAndReserved_ (right.clockSeqHiAndReserved_),
+ clockSeqLow_ (right.clockSeqLow_),
+ as_string_ (0)
+ {
+ ACE_NEW (node_,
+ UUID_node (*right.node_));
+ }
+
UUID::~UUID (void)
{
if (node_release_)
diff --git a/ACE/ace/UUID.h b/ACE/ace/UUID.h
index 552cee3b8ef..f56812915ef 100644
--- a/ACE/ace/UUID.h
+++ b/ACE/ace/UUID.h
@@ -84,6 +84,8 @@ namespace ACE_Utils
/// Constructs a UUID from a string representation.
UUID (const ACE_CString& uuidString);
+ UUID (const UUID &right);
+
// Destructor
~UUID (void);
@@ -132,9 +134,6 @@ namespace ACE_Utils
private:
void from_string_i (const ACE_CString& uuidString);
- // Copy constructor and assignment operator were not implemented
- // correctly, so I removed their implementation as an easy solution.
- UUID (const UUID&);
UUID& operator= (const UUID&);
/// Data Members for Class Attributes
diff --git a/ACE/tests/UUIDTest.cpp b/ACE/tests/UUIDTest.cpp
index 5c9818a19bb..e1800c6bc5d 100644
--- a/ACE/tests/UUIDTest.cpp
+++ b/ACE/tests/UUIDTest.cpp
@@ -54,6 +54,18 @@ Tester::test (void)
retval = -1;
}
+ // Construct UUID using the copy constructor
+ ACE_Utils::UUID new_uuid_copy (new_uuid);
+ ACE_DEBUG ((LM_DEBUG,
+ "UUID Constructed from above Generated UUID with copy\n %s\n",
+ new_uuid_copy.to_string ()->c_str ()));
+
+ if (new_uuid != new_uuid_copy)
+ {
+ ACE_ERROR ((LM_ERROR, "Error: UUIDs are not the same with copy\n"));
+ retval = -1;
+ }
+
// Generate UUID with process and thread ids.
ACE_Utils::UUID* uuid_with_tp_id =
ACE_Utils::UUID_GENERATOR::instance ()->generateUUID (0x0001, 0xc0);