Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (28 sloc) 0.544 kB
#include "playdar/utils/uuid.h"
#include <sstream>
#include <boost/uuid.hpp>
namespace playdar {
namespace utils {
class uuid_pimpl
{
public:
std::string gen()
{
boost::uuids::uuid u = m_gen();
std::ostringstream oss;
oss << u;
return oss.str();
}
boost::uuids::random_generator<> m_gen;
};
// use it like:
// uuid_gen gen;
// string val = gen();
uuid_gen::uuid_gen()
: m_pimpl( new uuid_pimpl() )
{}
std::string uuid_gen::operator()()
{
return m_pimpl->gen();
}
}} // ns
Jump to Line
Something went wrong with that request. Please try again.