CmUUID.h 571 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmModule.h"
  4. #include <random>
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Utility class for generating universally unique identifiers.
  9. *
  10. * @note Thread safe.
  11. */
  12. class CM_EXPORT UUIDGenerator : public Module<UUIDGenerator>
  13. {
  14. enum UUIDVersion
  15. {
  16. UUIDV_TimeBased = 0x01
  17. };
  18. public:
  19. UUIDGenerator();
  20. /**
  21. * @brief Generate a new random universally unique identifier.
  22. */
  23. String generateRandom();
  24. private:
  25. std::mt19937 mRandomGenerator;
  26. MACAddress mMACAddress;
  27. bool mHaveMacAddress;
  28. };
  29. }