HOPS
HOPS class reference
MHO_UUIDGenerator.hh
Go to the documentation of this file.
1 #ifndef MHO_UUIDGenerator_HH__
2 #define MHO_UUIDGenerator_HH__
3 
4 #include "MHO_UUID.hh"
5 #include <random>
6 #include <sstream>
7 #include <string>
8 
9 namespace hops
10 {
11 
23 {
24  public:
26  virtual ~MHO_UUIDGenerator();
27 
28  /*!* Generate a 128 bit psuedo-random UUID by following the RFC 4122 standard
29  * @param None
30  * @returns uuid MHO_UUID
31  */
33 
34  /*!* Convert the UUID to a string
35  * @param uuid MHO_UUID& which is a UUID passed by reference
36  * @returns ss string which is the string version of the UUID
37  */
38  std::string ConvertUUIDToString(MHO_UUID& uuid);
39 
40  /*!* Create a MHO_UUID UUID and convert it to a string
41  * @param None
42  * @returns uuid string
43  */
44  std::string GenerateUUIDAsString();
45 
46  private:
47  uint8_t fSyncWord[4]; //32 bits of sync word
48 
49  std::random_device fRandomDev;
50  std::mt19937* fRandomGen;
51  std::uniform_int_distribution< uint32_t >* fUniformDist;
52 };
53 
54 } // namespace hops
55 
56 #endif
Definition: MHO_UUIDGenerator.hh:23
MHO_UUID GenerateUUID()
Definition: MHO_UUIDGenerator.cc:20
std::string ConvertUUIDToString(MHO_UUID &uuid)
Definition: MHO_UUIDGenerator.cc:47
virtual ~MHO_UUIDGenerator()
Definition: MHO_UUIDGenerator.cc:14
MHO_UUIDGenerator()
Definition: MHO_UUIDGenerator.cc:8
std::string GenerateUUIDAsString()
Definition: MHO_UUIDGenerator.cc:61
Class MHO_UUID - a class for a 16 byte UUID (for object and type identification)
Definition: MHO_UUID.hh:27
Definition: MHO_ChannelLabeler.hh:17