Annwvyn::AnnStringUility Class Reference

String management utility. Every hashed string in the engine is generated by this object. More...

#include <AnnStringUtility.hpp>

Collaboration diagram for Annwvyn::AnnStringUility:

Public Member Functions

 AnnStringUility ()
 Construct the string utility. More...
 
 ~AnnStringUility ()
 Destruct the string utility. More...
 
size_t hash (const std::string &string) const
 Hash a string with the built-in hash algorithm of C++11. More...
 
std::string getRandomString (size_t length=15U)
 Get a string of random characters of specified length. 15 char by default. More...
 

Private Attributes

std::unique_ptr< std::hash< std::string > > stringHasher
 Hasher. More...
 
std::random_device r
 Random device, to seed the mt engine. More...
 
std::mt19937_64 mt
 mt engine More...
 

Detailed Description

String management utility. Every hashed string in the engine is generated by this object.

Definition at line 12 of file AnnStringUtility.hpp.

Constructor & Destructor Documentation

◆ AnnStringUility()

AnnStringUility::AnnStringUility ( )

Construct the string utility.

Definition at line 8 of file AnnStringUtility.cpp.

◆ ~AnnStringUility()

AnnStringUility::~AnnStringUility ( )

Destruct the string utility.

Definition at line 17 of file AnnStringUtility.cpp.

Member Function Documentation

◆ getRandomString()

std::string AnnStringUility::getRandomString ( size_t  length = 15U)

Get a string of random characters of specified length. 15 char by default.

Definition at line 27 of file AnnStringUtility.cpp.

Here is the call graph for this function:

◆ hash()

size_t AnnStringUility::hash ( const std::string string) const

Hash a string with the built-in hash algorithm of C++11.

Definition at line 22 of file AnnStringUtility.cpp.

Member Data Documentation

◆ mt

std::mt19937_64 Annwvyn::AnnStringUility::mt
private

mt engine

Definition at line 30 of file AnnStringUtility.hpp.

◆ r

std::random_device Annwvyn::AnnStringUility::r
private

Random device, to seed the mt engine.

Definition at line 28 of file AnnStringUtility.hpp.

◆ stringHasher

std::unique_ptr<std::hash<std::string> > Annwvyn::AnnStringUility::stringHasher
private

Hasher.

Definition at line 26 of file AnnStringUtility.hpp.


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