DCMTK Version 3.7.1
OFFIS DICOM Toolkit
Loading...
Searching...
No Matches
OFUUID Class Reference

An OFUUID represents a Universally Unique Identifier (UUID) as described in RFC 9562. More...

Public Types

enum  Notation {
  NotationInteger , NotationCanonical , NotationOID , NotationURN ,
  NotationDefault = NotationCanonical
}
 The possible notations of an OFUUID. More...

Public Member Functions

virtual ~OFUUID ()
 Destructor.
STD_NAMESPACE ostream & print (STD_NAMESPACE ostream &os, Notation const notation=NotationDefault) const
 Writes a string representation of this OFUUID to a stream.
OFString toString (Notation const notation=OFUUID::NotationDefault) const
 Returns a string representation of this OFUUID.

Static Public Attributes

static OFUUID const nil
 A OFFUID with all bits set to zero (0).
static OFUUID const max
 A OFFUID with all bits set to one (1).

Private Member Functions

 OFUUID (Uint8 const fill=0)
 Constructor.
 OFUUID (OFUUID const &other)
 Copy constructor.
OFUUID & operator= (OFUUID const &rhs)
 Copy assignment.
OFBool isMax () const
 Checks if this OFUUID is equal to OFUUID::max.
OFBool isNil () const
 Checks if this OFUUID is equal to OFUUID::nil.
void printCanonical (STD_NAMESPACE ostream &os) const
 Writes the OFUUID in canonical notation to a stream.
void printInteger (STD_NAMESPACE ostream &os) const
 Writes the OFUUID in integer notation to a stream.

Static Private Member Functions

static void divideBy10 (Uint8 const n, Uint8 &q, Uint8 &r)
 Given:

Private Attributes

Uint8 data_ [DATA_LENGTH]
 The data that makes up an OFUUID.

Static Private Attributes

static size_t const DATA_LENGTH = 16
 The number of Uint8 octets that make up this OFUUID.

Friends

class OFUUIDGenerator
 Means to create an OFUUID.
DCMTK_OFSTD_EXPORT STD_NAMESPACE ostream & operator<< (STD_NAMESPACE ostream &os, OFUUID const &uuid)
 Writes an OFUUID to a stream in canonical notation.
DCMTK_OFSTD_EXPORT OFBool operator== (OFUUID const &lhs, OFUUID const &rhs)
 Equality operator.
DCMTK_OFSTD_EXPORT OFBool operator!= (OFUUID const &lhs, OFUUID const &rhs)
 Inequality operator.
DCMTK_OFSTD_EXPORT OFBool operator< (OFUUID const &lhs, OFUUID const &rhs)
 Less than operator.
DCMTK_OFSTD_EXPORT OFBool operator<= (OFUUID const &lhs, OFUUID const &rhs)
 Less than or equal to operator.
DCMTK_OFSTD_EXPORT OFBool operator> (OFUUID const &lhs, OFUUID const &rhs)
 Greater than operator.
DCMTK_OFSTD_EXPORT OFBool operator>= (OFUUID const &lhs, OFUUID const &rhs)
 Greater than or equal to operator.

Detailed Description

An OFUUID represents a Universally Unique Identifier (UUID) as described in RFC 9562.

The constants OFUUID::nil and OFUUID::max do not comply to RFC 9562 but may be considered UUIDs nonetheless. See RFC 9562, sections 5.9 and 5.10 for details.

Member Enumeration Documentation

◆ Notation

The possible notations of an OFUUID.

Enumerator
NotationInteger 

The OFUUID is represented as one, long (unsigned) integer in base 10 (up to 39 digits long).

NotationCanonical 

The OFUUID is represented in the canonical "hex-and-dash" format consisting of multiple groups of lowercase alphanumeric hexadecimal characters separated by single dashes/hyphens.

NotationOID 

The OFUUID is represented in integer notation with the prefix 2.25.

NotationURN 

The OFUUID is represented in canonical notation with the prefix urn:uuid:.

NotationDefault 

The default notation that is used when none is given.

Constructor & Destructor Documentation

◆ OFUUID()

OFUUID::OFUUID ( Uint8 const fill = 0)
private

Constructor.

Parameters
fillValue to be assigned to each array member of data_.

To create an OFUUID use OFUUIDGenerator::create().

Referenced by OFUUID(), operator!=, operator<, operator<<, operator<=, operator=(), operator==, operator>, and operator>=.

Member Function Documentation

◆ divideBy10()

void OFUUID::divideBy10 ( Uint8 const n,
Uint8 & q,
Uint8 & r )
staticprivate

Given:

Uint8 m = n + r * 2^8;

This calculates the integer quotient q := m / 10 and the integer remainder r := m % 10.

Parameters
[in]nThe first summand of m (see above).
[out]qThe calculated quotient.
[in,out]rA factor of the second summand of m (see above). [in]
The calculated remainder. [out]

◆ isMax()

OFBool OFUUID::isMax ( ) const
private

Checks if this OFUUID is equal to OFUUID::max.

See RFC 9562, section 5.10 for details.

Returns
OFTrue iff all bits of data_ are one (1).

◆ isNil()

OFBool OFUUID::isNil ( ) const
private

Checks if this OFUUID is equal to OFUUID::nil.

See RFC 9562, section 5.9 for details.

Returns
OFTrue iff all bits of data_ are zero (0).

◆ print()

STD_NAMESPACE ostream & OFUUID::print ( STD_NAMESPACE ostream & os,
Notation const notation = NotationDefault ) const

Writes a string representation of this OFUUID to a stream.

Parameters
osThe stream to write to.
notationThe Notation to use.
Returns
os

References NotationDefault.

◆ printCanonical()

void OFUUID::printCanonical ( STD_NAMESPACE ostream & os) const
private

Writes the OFUUID in canonical notation to a stream.

Parameters
osThe stream to write to.

◆ printInteger()

void OFUUID::printInteger ( STD_NAMESPACE ostream & os) const
private

Writes the OFUUID in integer notation to a stream.

Parameters
osThe stream to write to.

◆ toString()

OFString OFUUID::toString ( Notation const notation = OFUUID::NotationDefault) const

Returns a string representation of this OFUUID.

Parameters
notationThe notation to use.
Returns
An OFString representing the current OFUUID.

References NotationDefault.

◆ operator!=

DCMTK_OFSTD_EXPORT OFBool operator!= ( OFUUID const & lhs,
OFUUID const & rhs )
friend

Inequality operator.

Parameters
lhsThe left OFUUID for comparison.
rhsThe right OFUUID for comparison.
Returns
OFTrue iff lhs' and rhs' integer notations are mathematically unequal.

References OFUUID().

◆ operator<

DCMTK_OFSTD_EXPORT OFBool operator< ( OFUUID const & lhs,
OFUUID const & rhs )
friend

Less than operator.

Parameters
lhsThe left OFUUID for comparison.
rhsThe right OFUUID for comparison.
Returns
OFTrue iff lhs' integer notation is mathematically smaller than rhs' integer notation.

References OFUUID().

◆ operator<<

DCMTK_OFSTD_EXPORT STD_NAMESPACE ostream & operator<< ( STD_NAMESPACE ostream & os,
OFUUID const & uuid )
friend

Writes an OFUUID to a stream in canonical notation.

Parameters
osThe stream to write to.
uuidThe OFUUID to write.
Returns
os

References OFUUID().

◆ operator<=

DCMTK_OFSTD_EXPORT OFBool operator<= ( OFUUID const & lhs,
OFUUID const & rhs )
friend

Less than or equal to operator.

Parameters
lhsThe left OFUUID for comparison.
rhsThe right OFUUID for comparison.
Returns
OFTrue iff lhs' integer notation is mathematically less than or equal to rhs' integer notation.

References OFUUID().

◆ operator==

DCMTK_OFSTD_EXPORT OFBool operator== ( OFUUID const & lhs,
OFUUID const & rhs )
friend

Equality operator.

Parameters
lhsThe left OFUUID for comparison.
rhsThe right OFUUID for comparison.
Returns
OFTrue iff lhs' and rhs' integer notations are mathematically equal.

References OFUUID().

◆ operator>

DCMTK_OFSTD_EXPORT OFBool operator> ( OFUUID const & lhs,
OFUUID const & rhs )
friend

Greater than operator.

Parameters
lhsThe left OFUUID for comparison.
rhsThe right OFUUID for comparison.
Returns
OFTrue iff lhs' integer notation is mathematically bigger than rhs' integer notation.

References OFUUID().

◆ operator>=

DCMTK_OFSTD_EXPORT OFBool operator>= ( OFUUID const & lhs,
OFUUID const & rhs )
friend

Greater than or equal to operator.

Parameters
lhsThe left OFUUID for comparison.
rhsThe right OFUUID for comparison.
Returns
OFTrue iff lhs' integer notation is mathematically bigger than or equal to rhs' integer notation.

References OFUUID().


The documentation for this class was generated from the following file:


Generated on for DCMTK Version 3.7.1 by Doxygen 1.18.0