Line data Source code
1 : #pragma once 2 : 3 : // This component provides a `class`, `RuntimeID`, that is a wrapper around an 4 : // RFC 4122 UUIDv4. `RuntimeID` identifies the current run of the application in 5 : // which this tracing library is embedded. 6 : // 7 : // See `TracerConfig::runtime_id`, declared in `tracer_config.h`. 8 : 9 : #include <string> 10 : 11 : namespace datadog { 12 : namespace tracing { 13 : 14 : class RuntimeID { 15 : std::string uuid_; 16 : RuntimeID(); 17 : 18 : public: 19 : // Return the canonical textual representation of this runtime ID. 20 83473 : const std::string& string() const { return uuid_; } 21 : 22 : // Return a pseudo-randomly generated runtime ID. The underlying generator is 23 : // `random_uint64()`, declared in `random.h`. 24 : static RuntimeID generate(); 25 : }; 26 : 27 : } // namespace tracing 28 : } // namespace datadog