summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl')
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl58
1 files changed, 58 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl
new file mode 100644
index 00000000000..e1238a12ff1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+UUID::UUID()
+{
+ create(rep_.uuid);
+}
+
+ACE_INLINE
+UUID::UUID(int)
+{
+}
+
+/// construct an UUID from the binary represetation
+ACE_INLINE
+UUID::UUID(const unsigned char* id)
+{
+ memcpy(rep_.uuid, id, 16);
+}
+
+ACE_INLINE
+bool UUID::operator == (const UUID& other) const
+{
+ return memcmp(this->rep_.uuid, other.rep_.uuid, BINRARY_LENGTH) == 0;
+}
+
+ACE_INLINE
+bool UUID::operator != (const UUID& other) const
+{
+ return !(*this == other);
+}
+
+
+ACE_INLINE
+bool UUID::is_valid() const
+{
+ return !this->rep_.timestamp.hi;
+}
+
+
+ACE_INLINE
+void UUID::to_binary(unsigned char* binary_rep) const
+{
+ memcpy(binary_rep, rep_.uuid, 16);
+}
+
+ACE_INLINE
+void UUID::to_string(ACE_CString& string) const
+{
+ string.resize(STRING_LENGTH-1);
+ this->to_string(&string[0]);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL