#include <coherence/util/UUID.hpp>
Inherits Object, Comparable, and PortableObject.
Public Types | ||||
typedef spec::Handle | Handle | |||
UUID Handle definition. | ||||
typedef spec::View | View | |||
UUID View definition. | ||||
typedef spec::Holder | Holder | |||
UUID Holder definition. | ||||
Public Member Functions | ||||
virtual bool | isGenerated () const | |||
True if the UUID was generated, and false if it was built. | ||||
virtual int64_t | getTimestamp () const | |||
Determine the date/time value for the UUID. | ||||
virtual bool | isAddressIncluded () const | |||
True if the IP address is a real IP address. | ||||
virtual Array < octet_t >::View | getAddress () const | |||
Determine the internet address of the host that generated the UUID instance. | ||||
virtual int32_t | getPort () const | |||
Determine the port portion of the UUID. | ||||
virtual int32_t | getCount () const | |||
Determine the "counter" portion of the UUID that ensures that two UUIDs generated at the same exact time by the same process are unique. | ||||
virtual Array < octet_t >::View | toByteArray () const | |||
Convert the UUID to a byte array of 32 bytes. | ||||
virtual int32_t | compareTo (Object::View v) const | |||
virtual void | readExternal (PofReader::Handle hIn) | |||
virtual void | writeExternal (PofWriter::Handle hOut) const | |||
virtual void | toStream (std::ostream &out) const | |||
Output a human-readable description of this Object to the given stream. coherence::lang::operator<<(std::ostream, Object::View) is defined and will call into the toStream method, to output Objects. If a managed String object is desired, the COH_TO_STRING macro can be used to build up a String from streamable contents.
Object::View vKey = ... Object::View vValue = ... std::cout << vKey << " = " << vValue << std::endl; String::Handle hs = COH_TO_STRING(vKey << " = " << vValue);
| ||||
virtual bool | equals (Object::View v) const | |||
virtual size32_t | hashCode () const | |||
Return a hash code value for the Object. This method is supported for the benefit of hash-based containers.
The general contract of
The default implementation is identity based.
| ||||
Protected Member Functions | ||||
UUID () | ||||
Generate a UUID. | ||||
UUID (int64_t lDateTime, InetAddress::View vAddr, int32_t nPort, int32_t nCount) | ||||
Build a UUID from its constituent members (advanced constructor). | ||||
UUID (int64_t lDateTime, Array< octet_t >::View vabIP, int32_t nPort, int32_t nCount) | ||||
Build a UUID from its constituent members (advanced constructor). | ||||
UUID (String::View vs) | ||||
Construct a UUID from a String. | ||||
UUID (Array< octet_t >::View vab) | ||||
Construct a UUID from a byte array. | ||||
Protected Attributes | ||||
int64_t | m_lDateTime | |||
System date/time value that the UUID instance was generated. | ||||
int32_t | m_nAddr1 | |||
Internet address of host that generated the UUID instance. | ||||
int32_t | m_nAddr2 | |||
The second four bytes of the IP address. | ||||
int32_t | m_nAddr3 | |||
The third four bytes of the IP address. | ||||
int32_t | m_nAddr4 | |||
The fourth four bytes of the IP address. | ||||
int32_t | m_nPort | |||
The least significant two bytes of this value are the port number if the UUID is built (not generated). | ||||
int32_t | m_nCount | |||
A rolling counter. | ||||
size32_t | m_nHash | |||
Cache the hash. | ||||
Static Protected Attributes | ||||
static const int32_t | mask_allflags | |||
A bit mask that represents the portion of the "port" value reserved for bit flags. | ||||
static const int32_t | mask_generated | |||
The bit mask for the "is generated UUID" flag. | ||||
static const int32_t | mask_realaddr | |||
The bit mask for the "is a real IP address" flag. | ||||
static const int32_t | mask_ipv6addr | |||
The bit mask for the "is an IPv6 address" flag. | ||||
static const int32_t | mask_unused | |||
The one remaining bit for future use. |
UUID | ( | int64_t | lDateTime, | |
InetAddress::View | vAddr, | |||
int32_t | nPort, | |||
int32_t | nCount | |||
) | [protected] |
UUID | ( | String::View | vs | ) | [protected] |
Construct a UUID from a byte array.
vab | a byte array as would be returned from UUID.toByteArray() |
virtual bool isGenerated | ( | ) | const [virtual] |
virtual int64_t getTimestamp | ( | ) | const [virtual] |
virtual bool isAddressIncluded | ( | ) | const [virtual] |
Determine the internet address of the host that generated the UUID instance.
virtual int32_t getPort | ( | ) | const [virtual] |
Determine the port portion of the UUID.
Note that the port is a 28-bit value; the first nibble is always 0x0.
virtual int32_t getCount | ( | ) | const [virtual] |
int32_t m_nAddr1 [mutable, protected] |
int32_t m_nAddr2 [mutable, protected] |
int32_t m_nAddr3 [mutable, protected] |
int32_t m_nAddr4 [mutable, protected] |
int32_t m_nPort [mutable, protected] |
size32_t m_nHash [mutable, protected] |
Cache the hash.
Only zero pending deserialization or generation.