diff options
author | michel_j <michel_j@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-09-02 23:03:34 +0000 |
---|---|---|
committer | michel_j <michel_j@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-09-02 23:03:34 +0000 |
commit | baecfb8e4c3635d860f712b7288acc9eaa211959 (patch) | |
tree | 8af1ca5533541a9308635f0b28d0f54ada3c08e2 | |
parent | 77ec440b83873bad8eee36cfea8a5e300d36862b (diff) | |
download | ATCD-baecfb8e4c3635d860f712b7288acc9eaa211959.tar.gz |
Tue Sep 2 18:00:00 2003 Justin Michel <michel_j@ociweb.com>
-rw-r--r-- | ChangeLog | 20 | ||||
-rw-r--r-- | ace/UUID.cpp | 16 | ||||
-rw-r--r-- | ace/UUID.h | 35 | ||||
-rw-r--r-- | ace/UUID.inl | 190 | ||||
-rw-r--r-- | tests/tests.mpc | 7 |
5 files changed, 133 insertions, 135 deletions
diff --git a/ChangeLog b/ChangeLog index 1cf4a4df12b..7b7ebfbab17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +Tue Sep 2 18:00:00 2003 Justin Michel <michel_j@ociweb.com> + + * ace/UUID.cpp: + * ace/UUID.h: + * ace/UUID.i: + + Removed implementations of copy constructors and assignment + operators, and made them private. These were not correct, and + would cause an infinite loop if ever called. I also had to + comment out several other broken operators that were using the + copy constructors or assignment operators. In general, someone + should take a close look at these classes, and either fix all the + many problems, or remove apparently unnecessary features entirely. + + * test/tests.mpc: + + Added support for the UUID test. This test really doesn't test + very much right now, as it still passed even though I had removed + most of the functionality from the uuid classes. + Tue Sep 2 17:25:24 UTC 2003 Trevor Fields <fields_t@ociweb.com> * examples/Web_Crawler/Command_Processor.h diff --git a/ace/UUID.cpp b/ace/UUID.cpp index cd82c642cef..3a2b0931d86 100644 --- a/ace/UUID.cpp +++ b/ace/UUID.cpp @@ -56,18 +56,6 @@ namespace ACE_Utils node_release_ = 1; } - UUID::UUID(const UUID &right) - : timeLow_ (0), - timeMid_ (0), - timeHiAndVersion_ (0), - clockSeqHiAndReserved_ (0), - clockSeqLow_ (0), - as_string_ (0) - { - node_release_ = 0; - *this = right; - } - /// Construct a UUID from a string representation of an UUID. UUID::UUID (const ACE_CString& uuid_string) : timeLow_ (0), @@ -95,7 +83,9 @@ namespace ACE_Utils /// Special case for the nil UUID. if (uuid_string == *NIL_UUID.to_string()) { - *this = NIL_UUID; + bool copy_constructor_not_supported = false; + ACE_ASSERT(copy_constructor_not_supported); + //*this = NIL_UUID; return; } diff --git a/ace/UUID.h b/ace/UUID.h index 428cc734372..631ac673eca 100644 --- a/ace/UUID.h +++ b/ace/UUID.h @@ -40,15 +40,12 @@ namespace ACE_Utils NodeID& nodeID (void); void nodeID (NodeID&); - /// Assignment Operation - UUID_node &operator=(const UUID_node &right); + ///// Equality Operations + //bool operator == (const UUID_node& right) const; + //bool operator != (const UUID_node& right) const; - /// Equality Operations - bool operator == (const UUID_node& right) const; - bool operator != (const UUID_node& right) const; - - /// Relational Operations - bool operator < (const UUID_node& right) const; + ///// Relational Operations + //bool operator < (const UUID_node& right) const; private: NodeID nodeID_; @@ -81,9 +78,6 @@ namespace ACE_Utils /// Constructor UUID (void); - /// Copy constructor - UUID (const UUID &right); - /// Constructs a UUID from a string representation. UUID (const ACE_CString& uuidString); @@ -119,20 +113,21 @@ namespace ACE_Utils static UUID NIL_UUID; - /// Assignment Operation - UUID & operator= (const UUID &right); - /// Equality Operations - bool operator== (const UUID &right) const; - bool operator!= (const UUID &right) const; + //bool operator== (const UUID &right) const; + //bool operator!= (const UUID &right) const; /// Relational Operations - bool operator< (const UUID &right) const; - bool operator> (const UUID &right) const; - bool operator<= (const UUID &right) const; - bool operator>= (const UUID &right) const; + //bool operator< (const UUID &right) const; + //bool operator> (const UUID &right) const; + //bool operator<= (const UUID &right) const; + //bool operator>= (const UUID &right) const; private: + // 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 ACE_UINT32 timeLow_; diff --git a/ace/UUID.inl b/ace/UUID.inl index dcf060520ce..943efefb4d9 100644 --- a/ace/UUID.inl +++ b/ace/UUID.inl @@ -105,106 +105,92 @@ namespace ACE_Utils this->pid_ = pid; } - ACE_INLINE UUID& - UUID::operator = (const UUID &right) - { - *this = right; - return *this; - } - - ACE_INLINE bool - UUID::operator == (const UUID &right) const - { - UUID rt (right); - if ((timeLow_ != rt.timeLow ()) || - (timeMid_ != rt.timeMid ()) || - (timeHiAndVersion_ != rt.timeHiAndVersion ()) || - (clockSeqHiAndReserved_ != rt.clockSeqHiAndReserved ()) || - (clockSeqLow_ != rt.clockSeqLow ()) || - (node_ != rt.node ())) - { - return false; - } - - return true; - } - - ACE_INLINE bool - UUID::operator != (const UUID &right) const - { - return !(*this == right); - } - - ACE_INLINE bool -UUID::operator < (const UUID &rt) const - { - UUID right (rt); - if ((timeLow_ < right.timeLow ()) || - (timeMid_ < right.timeMid ()) || - (timeHiAndVersion_ < right.timeHiAndVersion ()) || - (clockSeqHiAndReserved_ < right.clockSeqHiAndReserved ()) || - (clockSeqLow_ < right.clockSeqLow ()) || - (node_ < right.node ())) - { - return true; - } - - return false; - } - - ACE_INLINE bool - UUID::operator > (const UUID &right) const - { - return right < *this; - } - - ACE_INLINE bool - UUID::operator <= (const UUID &right) const - { - return !(*this > right); - } - - ACE_INLINE bool - UUID::operator >= (const UUID &right) const - { - return !(*this < right); - } - - ACE_INLINE UUID_node& - UUID_node::operator = (const UUID_node &right) - { - *this = right; - return *this; - } - - ACE_INLINE bool - UUID_node::operator == (const UUID_node& rt) const - { - UUID_node right = rt; - for (size_t i = 0; i < NODE_ID_SIZE; ++i) - { - if (nodeID_ [i] != right.nodeID ()[i]) - { - return false; - } - } - return true; - } - - ACE_INLINE bool - UUID_node::operator != (const UUID_node& right) const - { - return !(*this == right); - } - - ACE_INLINE bool - UUID_node::operator < (const UUID_node& rt) const - { - UUID_node right = rt; - for (size_t i = 0; i < NODE_ID_SIZE; ++i) - if (nodeID_ [i] < right.nodeID ()[i]) - return true; - - return false; - } + //ACE_INLINE bool + //UUID::operator == (const UUID &right) const + //{ + // UUID rt (right); + // if ((timeLow_ != rt.timeLow ()) || + // (timeMid_ != rt.timeMid ()) || + // (timeHiAndVersion_ != rt.timeHiAndVersion ()) || + // (clockSeqHiAndReserved_ != rt.clockSeqHiAndReserved ()) || + // (clockSeqLow_ != rt.clockSeqLow ()) || + // (node_ != rt.node ())) + // { + // return false; + // } + + // return true; + //} + + //ACE_INLINE bool + //UUID::operator != (const UUID &right) const + //{ + // return !(*this == right); + //} + +// ACE_INLINE bool +//UUID::operator < (const UUID &rt) const +// { +// UUID right (rt); +// if ((timeLow_ < right.timeLow ()) || +// (timeMid_ < right.timeMid ()) || +// (timeHiAndVersion_ < right.timeHiAndVersion ()) || +// (clockSeqHiAndReserved_ < right.clockSeqHiAndReserved ()) || +// (clockSeqLow_ < right.clockSeqLow ()) || +// (node_ < right.node ())) +// { +// return true; +// } +// +// return false; +// } +// +// ACE_INLINE bool +// UUID::operator > (const UUID &right) const +// { +// return right < *this; +// } +// +// ACE_INLINE bool +// UUID::operator <= (const UUID &right) const +// { +// return !(*this > right); +// } +// +// ACE_INLINE bool +// UUID::operator >= (const UUID &right) const +// { +// return !(*this < right); +// } +// +// ACE_INLINE bool +// UUID_node::operator == (const UUID_node& rt) const +// { +// UUID_node right = rt; +// for (size_t i = 0; i < NODE_ID_SIZE; ++i) +// { +// if (nodeID_ [i] != right.nodeID ()[i]) +// { +// return false; +// } +// } +// return true; +// } +// +// ACE_INLINE bool +// UUID_node::operator != (const UUID_node& right) const +// { +// return !(*this == right); +// } +// +// ACE_INLINE bool +// UUID_node::operator < (const UUID_node& rt) const +// { +// UUID_node right = rt; +// for (size_t i = 0; i < NODE_ID_SIZE; ++i) +// if (nodeID_ [i] < right.nodeID ()[i]) +// return true; +// +// return false; +// } }; diff --git a/tests/tests.mpc b/tests/tests.mpc index 0ac72d7dec7..7a7d18175d7 100644 --- a/tests/tests.mpc +++ b/tests/tests.mpc @@ -1030,3 +1030,10 @@ project(Reactor Registration Test) : acetest { Header_Files { } } + +project(UUID Test) : acetest { + exename = UUIDTest + Source_Files { + UUIDTest.cpp + } +} |