Kea  1.9.9-git
isc::util::random::QidGenerator Class Reference

This class generates Qids for outgoing queries. More...

#include <qid_gen.h>

Public Member Functions

 QidGenerator ()
 Default constructor. More...
 
uint16_t generateQid ()
 Generate a Qid. More...
 
void seed ()
 Seeds the QidGenerator (based on the current time) More...
 

Static Public Member Functions

static QidGeneratorgetInstance ()
 Returns the singleton instance of the QidGenerator. More...
 

Detailed Description

This class generates Qids for outgoing queries.

It is implemented as a singleton; the public way to access it is to call getInstance()->generateQid().

It automatically seeds it with the current time when it is first used.

Definition at line 33 of file qid_gen.h.

Constructor & Destructor Documentation

isc::util::random::QidGenerator::QidGenerator ( )

Default constructor.

It is recommended that getInstance is used rather than creating separate instances of this class.

The constructor automatically seeds the generator with the current time.

Definition at line 30 of file qid_gen.cc.

References seed().

+ Here is the call graph for this function:

Member Function Documentation

uint16_t isc::util::random::QidGenerator::generateQid ( )

Generate a Qid.

Returns
A random Qid

Definition at line 44 of file qid_gen.cc.

QidGenerator & isc::util::random::QidGenerator::getInstance ( )
static

Returns the singleton instance of the QidGenerator.

Returns a reference to the singleton instance of the generator

Definition at line 26 of file qid_gen.cc.

void isc::util::random::QidGenerator::seed ( )

Seeds the QidGenerator (based on the current time)

This is automatically called by the constructor

Definition at line 37 of file qid_gen.cc.

Referenced by QidGenerator().


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