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

The OFUUIDGenerator class provides a means to create an OFUUID. More...

Classes

class  Uint32_32
 Helper type for internal use in OFUUIDGenerator. More...

Public Types

typedef Uint8(*) rnd8()
 The type of a user providable random number generator (RNG) functor.

Static Public Member Functions

static OFshared_ptr< OFUUID > create (rnd8 const &=getRND8)
 Creates an OFUUID based on RFC 9562, section 5.7.

Private Member Functions

 OFUUIDGenerator ()
 Default constructor.
virtual ~OFUUIDGenerator ()
 Destructor.

Static Private Member Functions

static Uint32_32 getMillisecondsSinceEpoch ()
 Calculates the number of milliseconds since January 1, 1970.
static Uint8 getRND8 ()
 Wrapper for OFRandom::getRND8.
static OFBool initializeIfNecessary ()
 Checks whether initialization is necessary and performs it if required.
static void setupOFUUIDDataMember (OFUUID *const ofuuid, rnd8 const &rnd)
 Sets up the individual fields (OFUUID::data_) of an OFUUID.

Detailed Description

The OFUUIDGenerator class provides a means to create an OFUUID.

Member Function Documentation

◆ create()

OFshared_ptr< OFUUID > OFUUIDGenerator::create ( rnd8 const & = getRND8)
static

Creates an OFUUID based on RFC 9562, section 5.7.

Parameters
rndA random number generator (RNG) functor. Provide if special requirements with respect to unguessability of the to be created OFUUID exist. See RFC 9562, section 6.9 for details.
Returns
A OFshared_ptr encapsulating a newly created OFUUID instance.
Warning
The returned object may contain a null pointer (OFnullptr_t).

References getRND8().

◆ getMillisecondsSinceEpoch()

Uint32_32 OFUUIDGenerator::getMillisecondsSinceEpoch ( )
staticprivate

Calculates the number of milliseconds since January 1, 1970.

Returns
The number of milliseconds calculated.
Warning
The result "is affected by discontinuous jumps in the system time (e.g., if the system administrator manually changes the system time)." gettimeofday(2)

◆ getRND8()

Uint8 OFUUIDGenerator::getRND8 ( )
staticprivate

Wrapper for OFRandom::getRND8.

Returns
A random Uint8 value.

Referenced by create().

◆ initializeIfNecessary()

OFBool OFUUIDGenerator::initializeIfNecessary ( )
staticprivate

Checks whether initialization is necessary and performs it if required.

Returns
OFTrue iff initialization succeeded.

◆ setupOFUUIDDataMember()

void OFUUIDGenerator::setupOFUUIDDataMember ( OFUUID *const ofuuid,
rnd8 const & rnd )
staticprivate

Sets up the individual fields (OFUUID::data_) of an OFUUID.

Parameters
[in,out]ofuuidThe to be assembled OFUUID.
[in]rndThe random number genaratr functor to use.

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


Generated on for DCMTK Version 3.7.1 by Doxygen 1.18.0